diff --git a/src/lib/components/modal.svelte b/src/lib/components/modal.svelte index 0626393404..ace5aa01c9 100644 --- a/src/lib/components/modal.svelte +++ b/src/lib/components/modal.svelte @@ -27,6 +27,16 @@ $: if (error) { alert?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' }); } + + // Melt UI's ComboBox (and other listbox-based components) call removeScroll() + // when they open, which adds overflow:hidden + compensatory padding-right + $: if (typeof document !== 'undefined') { + if (show) { + document.body.setAttribute('data-melt-scroll-lock', ''); + } else { + document.body.removeAttribute('data-melt-scroll-lock'); + } + }