mirror of https://github.com/sveltejs/svelte
Merge 8c51545843 into 020242d6be
commit
965537bb98
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: keep inline `overflow-x`/`overflow-y` after a transition ends
|
||||
@ -0,0 +1,12 @@
|
||||
import { test } from '../../assert';
|
||||
|
||||
export default test({
|
||||
async test({ assert, window }) {
|
||||
window.document.querySelector('button')?.click();
|
||||
await new Promise((r) => setTimeout(r, 200));
|
||||
|
||||
const [a, b] = window.document.querySelectorAll('div');
|
||||
assert.equal(a.style.overflowX, 'auto');
|
||||
assert.equal(b.style.overflowY, 'scroll');
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,24 @@
|
||||
<script>
|
||||
function fade() {
|
||||
return {
|
||||
duration: 50,
|
||||
css: (t) => `opacity: ${t}`
|
||||
};
|
||||
}
|
||||
|
||||
function slide() {
|
||||
return {
|
||||
duration: 50,
|
||||
css: (t) => `overflow: hidden; opacity: ${t}`
|
||||
};
|
||||
}
|
||||
|
||||
let visible = $state(false);
|
||||
</script>
|
||||
|
||||
<button onclick={() => (visible = !visible)}>toggle</button>
|
||||
|
||||
{#if visible}
|
||||
<div style="overflow-x: auto" transition:fade>a</div>
|
||||
<div style="overflow-y: scroll" transition:slide>b</div>
|
||||
{/if}
|
||||
Loading…
Reference in new issue