-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix Dropdown Option Removal Regression #2816
Conversation
components/dash-core-components/src/fragments/Dropdown.react.js
Outdated
Show resolved
Hide resolved
I changed it so it only checks The test could probably be simplified (i.e. 1 or 2 callbacks), but I wanted to make a clear distinction between the removal of the item and then checking the value afterwards. |
components/dash-core-components/tests/integration/dropdown/test_remove_option.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 💃
Fixes #2733.
The tests for the option removal only included non-searchable dropdowns.
The problem was that the guard clause would always be false for searchable dropdowns and the props on the component were never updated, even though the React component was showing the expected behavior. Removing the
!searchable
reintroduced another issue (#2099), so there needed to be a way to know if there was a current search happening or if the options had actually been changed.Instead of using
searchable
, create a state that is changed when the input is changed, indicating a search is being done. If there is a current search, don't update the options (and hence, don't render changes), else update the options.Contributor Checklist
search_value
.True
andFalse
.optionals
CHANGELOG.md