rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.27k stars 180 forks source link

v5 select within scrollable modal [possible enhancement proposed] #443

Closed bewards closed 2 years ago

bewards commented 2 years ago

Issue When a default svelte-select component is placed within a scrollable modal, the list doesn't update to stay with the dropdown and instead goes with the modal scroll area down the modal. This can be seen in the REPL below by opening the modal and selecting the first dropdown and scrolling down the modal. The second dropdown can fix this with the caveat that you will have to use the appendListTarget prop for every dropdown in the modal, which requires binding of more variables for the target element. If a proposed new prop is used, appendListAfterSelect, then this could append the list directly after the svelte-select without the need for target elements, and only a parent container is needed (which should be done anyways for all dropdowns to override theme).

REPL: https://svelte.dev/repl/ad4d688b4dd24210ab235bcba717e8c0?version=3.49.0

rob-balfre commented 2 years ago

@bewards should just work now...

Updated REPL https://svelte.dev/repl/9a084ad506554933a44a13bcad98b211?version=3.49.0