From f4393b1343e155e5713eea83ebdd017e51b5e77a Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab <59809993+abzokhattab@users.noreply.github.com> Date: Thu, 15 Feb 2024 00:39:46 +0200 Subject: [PATCH] minor edit Co-authored-by: Monil Bhavsar --- src/components/SelectionList/BaseSelectionList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index cdea6b2a2473..e81bbb27d20e 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -355,7 +355,7 @@ function BaseSelectionList( return; } // Remove the focus if the search input is empty else focus on the first non disabled item - const newSelectedIndex = textInputValue !== '' ? 0 : -1; + const newSelectedIndex = textInputValue === '' ? -1 : 0; updateAndScrollToFocusedIndex(newSelectedIndex); }, [canSelectMultiple, flattenedSections.allOptions.length, prevTextInputValue, textInputValue, updateAndScrollToFocusedIndex]);