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

Prevent Scroll Into View @v5 #497

Open yoh-extradat opened 1 year ago

yoh-extradat commented 1 year ago

Is there any chance to disable the scroll into view behavior? I am using the Select Field inside a table and on click the whole table scrolls to the left for the drop down open on the left border of the table. It's quite annoying and as the select element is already in view i would love to disable the scroll to behavior!

rob-balfre commented 1 year ago

@yoh-extradat struggling to recreate this, can you provide an REPL or code example? Thanks.

stephenlrandall commented 1 year ago

I ran into a similar issue as well when putting the Select inside a position: sticky sidebar. I refactored my CSS to use position: fixed and the issue resolved itself, but it does seem like something is going on there.

I don't mind the scroll behavior when opening the Select to show the selected item (CSS issues notwithstanding), but the scroll-to-hovered-item behavior is quite annoying since you don't typically want things moving around as you just move the mouse without scrolling yourself. Makes it hard to hit targets:

https://user-images.githubusercontent.com/41397226/232898457-2b3b78d2-21ae-41a1-a2a8-076ee08d27fe.mov

You can also see it acting up in the main REPL:

https://user-images.githubusercontent.com/41397226/232897508-5befb52e-c661-4bb3-b6c3-17c2b3fd1378.mov

@rob-balfre Would it be possible to have a prop to at least disable the scroll-to-hover behavior?

akkaradej commented 1 year ago

@yoh-extradat I try latest version 5.6.0 it's fixed.