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: undefined param in optionDiabled #3689

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

oddvernes
Copy link
Collaborator

resolves #3677

For some reason selectedItems (returned from useMultipleSelection from downshift) contains an array with null ([null]) if you have a controlled singleselect and update selectedOptions with an empty array from the outside. This then causes the component to crash if optionDisabled is defined and tries to read a property from null. I have fixed this by adding an extra null check when creating the selectedDisabledItemsSet

Copy link
Collaborator

@torleifhalseth torleifhalseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

@oddvernes oddvernes merged commit ea564fd into develop Nov 20, 2024
6 checks passed
@oddvernes oddvernes deleted the OOVE/3677-autocomplete-optionsdisabled-bug branch November 20, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocomplete 'option' parameter becomes 'undefined' in 'optionDisabled' callback
2 participants