Skip to content

Commit 9fd0340

Browse files
committed
fix: account for min-width/height in slide transition
1 parent 4aadb34 commit 9fd0340

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/gold-olives-care.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: account for min-width/height in `slide` transition

packages/svelte/src/transition/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export function slide(node, { delay = 0, duration = 400, easing = cubic_out, axi
131131
`margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +
132132
`margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +
133133
`border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +
134-
`border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
134+
`border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` +
135+
`min-${primary_property}: 0`
135136
};
136137
}
137138

packages/svelte/tests/runtime-legacy/samples/class-shortcut-with-transition/_config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default test({
1818
raf.tick(150);
1919
assert.htmlEqual(
2020
target.innerHTML,
21-
'<p>foo</p><p class="red svelte-1yszte8 border" style="overflow: hidden; opacity: 0; border-top-width: 0.5px; border-bottom-width: 0.5px;">bar</p>'
21+
'<p>foo</p><p class="red svelte-1yszte8 border" style="overflow: hidden; opacity: 0; border-top-width: 0.5px; border-bottom-width: 0.5px; min-height: 0;">bar</p>'
2222
);
2323
component.open = true;
2424
raf.tick(250);

0 commit comments

Comments
 (0)