Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete: Inifinite loop triggered when pressing keyup/keydown in autocomplete with optionDisabled function #3566

Closed
mhwaage opened this issue Jul 29, 2024 · 1 comment · Fixed by #3565
Labels
🐛 bug Something isn't working

Comments

@mhwaage
Copy link
Contributor

mhwaage commented Jul 29, 2024

Describe the bug
For autocompletes with an optionDisabled prop that returns true for undefined, pressing keyDown or keyUp can trigger a crash.

Steps to reproduce the bug

  1. Render an autocomplete with some options disabled
  2. Filter by text so that only disabled options are visible
  3. Press up/down on keyboard
  4. Crash from infinite loop

Expected behavior

No crash

Specifications

  • Version: 0.37.0
  • Browser: Edge
  • OS: Windows

Additional context
I have added a pull request (#3565) that creates a test case that exposes this issue, and makes that test case pass.

@mhwaage mhwaage added the 🐛 bug Something isn't working label Jul 29, 2024
@mhwaage
Copy link
Contributor Author

mhwaage commented Jul 30, 2024

As described, this is a near duplicate of #3521 which was fixed in #3534 . However, #3534 failed to fix an edge case where there are non-disabled items that have been filtered out via the search field.

@oddvernes oddvernes linked a pull request Aug 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant