Skip to content

Commit

Permalink
UnifiedPicker: Don't show picker after input is cleared (#16937)
Browse files Browse the repository at this point in the history
* add empty check

* Change files
  • Loading branch information
elisabethcvs authored Feb 11, 2021
1 parent 8ee2abd commit 4e3e437
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "UnifiedPicker: Don't show picker after input is cleared",
"packageName": "@fluentui/react-experiments",
"email": "elvonspa@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ export const UnifiedPicker = <T extends {}>(props: IUnifiedPickerProps<T>): JSX.
else if (focusItemIndex === -1 && headerItemIndex === -1 && footerItemIndex === -1) {
setFocusItemIndex(0);
}
!isSuggestionsShown ? showPicker(true) : null;
// if suggestions aren't showing and we haven't just cleared the input, show the picker
!isSuggestionsShown && value !== '' ? showPicker(true) : null;
if (!resultItemsList) {
resultItemsList = [];
}
Expand Down

0 comments on commit 4e3e437

Please sign in to comment.