File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
components/dash-core-components
tests/integration/dropdown Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
99
1010## Fixed
1111- [#3629](https://github.com/plotly/dash/pull/3629) Fix date pickers not showing date when initially rendered in a hidden container.
12+ - [#3627][(](https://github.com/plotly/dash/pull/3627)) Make dropdowns searchable wheen focused, without requiring to open them first
1213
1314
1415
Original file line number Diff line number Diff line change @@ -539,9 +539,18 @@ const Dropdown = (props: DropdownProps) => {
539539 const firstVal = displayOptions [ 0 ] . value ;
540540 const isSelected =
541541 sanitizedValues . includes ( firstVal ) ;
542- const newSelection = isSelected
543- ? without ( [ firstVal ] , sanitizedValues )
544- : append ( firstVal , sanitizedValues ) ;
542+ let newSelection ;
543+ if ( isSelected ) {
544+ newSelection = without (
545+ [ firstVal ] ,
546+ sanitizedValues
547+ ) ;
548+ } else {
549+ newSelection = append (
550+ firstVal ,
551+ sanitizedValues
552+ ) ;
553+ }
545554 updateSelection ( newSelection ) ;
546555 } }
547556 ref = { searchInputRef }
Original file line number Diff line number Diff line change @@ -678,7 +678,11 @@ def update_output(value):
678678 dash_duo .wait_for_text_to_equal ("#output" , "Selected: Cambodia" )
679679
680680 # Type "can" — should filter to only Canada
681- send_keys ("can" )
681+ send_keys ("c" )
682+ sleep (0.1 )
683+ send_keys ("a" )
684+ sleep (0.1 )
685+ send_keys ("n" )
682686 sleep (0.1 )
683687 options = dash_duo .find_elements (".dash-dropdown-option" )
684688 assert len (options ) == 1
You can’t perform that action at this time.
0 commit comments