Skip to content

Commit dff4b92

Browse files
r0b1ngjulivan
authored andcommitted
fix: fill in search term only on explicit input change, clear otherwise
The search term should not be filled with prefilled values when user interacts with the widget. This fixes the issues with filter being applied unnecessarily.
1 parent c0af7e2 commit dff4b92

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/pluggableWidgets/combobox-web/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
### Fixed
1212

1313
- We fixed an issue where combobox failed to render a proper width on auto-fit container.
14+
- We fixed an issue with combobox unnecessary applying filtering.
1415

1516
- We fixed an issue where combobox lazy load is not working on initial load.
1617

packages/pluggableWidgets/combobox-web/src/hooks/useDownshiftSingleSelectProps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export function useDownshiftSingleSelectProps(
3030
selector.setValue(selectedItem ?? null);
3131
},
3232
onInputValueChange({ inputValue, type }: UseComboboxStateChange<string>) {
33-
selector.options.setSearchTerm(inputValue!);
3433
if (selector.onFilterInputChange && type === useCombobox.stateChangeTypes.InputChange) {
34+
selector.options.setSearchTerm(inputValue!);
3535
selector.onFilterInputChange(inputValue!);
36+
} else {
37+
selector.options.setSearchTerm("");
3638
}
3739
},
3840
getA11yStatusMessage(options) {

0 commit comments

Comments
 (0)