equinor / design-system

The Equinor design system
MIT License
116 stars 62 forks source link

When clicking Autocomplete's Select All really fast, everything crashes. #3426

Closed mhwaage closed 1 month ago

mhwaage commented 1 month ago

Describe the bug

When clicking Autocomplete's Select All really fast, everything crashes.

Steps to reproduce the bug

  1. Have a convoluted enough enironment that there is lag when selecting options in Autocomplete
  2. Set up a controlled Autocomplete component
  3. Click Select All twice, faster than the component can update between
  4. Crash

Expected behavior No crash

Specifications

Additional context image Crash is reported as happening in: image

mhwaage commented 1 month ago

I'll try to experiment with resolving locally, since it has proven difficult to set up an MRE.

oddvernes commented 1 month ago

I found the commit where this useEffect "if (isControlled)" was added from this pull request. Unfortunately it doesn't tell us anything about why it was added, just "Also found some bugs related to controlled that was fixed 🐛". Im going to test more if removing this doesn't have any side effects. Unfortunately havent been able to reproduce the crash yet

oddvernes commented 1 month ago

reolved by #3428