diff --git a/.changeset/gold-olives-care.md b/.changeset/gold-olives-care.md new file mode 100644 index 0000000000..9f7357c6da --- /dev/null +++ b/.changeset/gold-olives-care.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: account for min-width/height in `slide` transition diff --git a/packages/svelte/src/transition/index.js b/packages/svelte/src/transition/index.js index 4123106211..aacc6b6cf3 100644 --- a/packages/svelte/src/transition/index.js +++ b/packages/svelte/src/transition/index.js @@ -131,7 +131,8 @@ export function slide(node, { delay = 0, duration = 400, easing = cubic_out, axi `margin-${secondary_properties[0]}: ${t * margin_start_value}px;` + `margin-${secondary_properties[1]}: ${t * margin_end_value}px;` + `border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` + - `border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` + `border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` + + `min-${primary_property}: 0` }; } diff --git a/packages/svelte/tests/runtime-legacy/samples/class-shortcut-with-transition/_config.js b/packages/svelte/tests/runtime-legacy/samples/class-shortcut-with-transition/_config.js index 6e3f7a3cb7..e58e8c53c5 100644 --- a/packages/svelte/tests/runtime-legacy/samples/class-shortcut-with-transition/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/class-shortcut-with-transition/_config.js @@ -18,7 +18,7 @@ export default test({ raf.tick(150); assert.htmlEqual( target.innerHTML, - '

foo

bar

' + '

foo

bar

' ); component.open = true; raf.tick(250);