svelecte icon indicating copy to clipboard operation
svelecte copied to clipboard

Show current selection in the list when dropdown is re-opened

Open szegheo opened this issue 1 year ago • 4 comments

Another unusual behavior IMHO:

  1. Select an item (e.g. Greece on the demo page (Country as Options)
  2. Click the select again to let the dropdown list open
  3. Start scrolling down the list BUT DO NOT select anything this time!
  4. Click outside to let the dropdown closed
  5. Click the select again to let the dropdown list open
  6. Previous scroll is remembered (instead current selected value)

In step5 I think the list should rather show the current selection (value) highlighted. Only if not option multiple of course.

This would be very important in my project, because I'm trying to replace my app's old select component to Svelecte with as little difference as possible.

Thank you!

szegheo avatar Sep 13 '23 12:09 szegheo

Added. Hopefully I haven't missed any (unknown) edge case. If you like svelecte, you can show your appreciation by some donation.

mskocik avatar Sep 13 '23 17:09 mskocik

Unfortunately this doesn't work in my test: REPL Actually, it went worse, I see some rendering problems: image

szegheo avatar Sep 14 '23 07:09 szegheo

It's getting messy 😁 I noticed you are using virtualList which won't scroll properly.

It's weird, that it worked for normal dropdown yesterday... but is "off" now (only the 'active dropdown item' is set correctly).

Will need more work I have no time for right now 🫤

mskocik avatar Sep 14 '23 08:09 mskocik

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 3 days.

github-actions[bot] avatar Oct 06 '23 02:10 github-actions[bot]