equinor / design-system

The Equinor design system
MIT License
121 stars 64 forks source link

:bug: Select All option in Autocomplete component disappears on scroll #3655

Open magnh opened 1 month ago

magnh commented 1 month ago

Describe the bug

When you have 30 items or more, the Select All option disappears when scrolling. I assume the issues is caused by useVirtualizer removing the option.

https://codesandbox.io/p/sandbox/eds-autocomplete-select-all-disappearing-xrn9qm

Steps to reproduce the bug

  1. Open https://codesandbox.io/p/sandbox/eds-autocomplete-select-all-disappearing-xrn9qm
  2. Scroll far down
  3. See the Select All option disappear

Expected behavior

It should not disappear.

Specifications

Additional context

https://codesandbox.io/p/sandbox/eds-autocomplete-select-all-disappearing-xrn9qm

oddvernes commented 1 month ago

This makes sense as the select all "item" is injected into the rest of the options and handled by the virtualizer. I remember @yusijs tried a bunch of stuff and this was the solution that played nice with the virtualizer. We'll have to take another look if there is something we can do here about this 👍

magnh commented 1 month ago

Great, thank you @oddvernes 💯