Skip to content

Commit 6ab48e1

Browse files
chore(DropdownLight.jsx): changed variable name to name with better semantics
1 parent 8f5f3d8 commit 6ab48e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/DropdownLight/DropdownLight.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ const DropdownLight = ({
210210
const downPress = useKeyPress('ArrowDown');
211211
const upPress = useKeyPress('ArrowUp');
212212
const enterPress = useKeyPress('Enter');
213-
const filteredItemIndex = useKeyboardSearchItems(items, cursor, isOpen);
213+
const focusedItemIndex = useKeyboardSearchItems(items, cursor, isOpen);
214214
const EscapeKeyPressValue = 'Escape';
215215

216216
const handleToggleDropdown = () => {
217217
setIsOpen(!isOpen);
218218
};
219219

220220
useEffect(() => {
221-
const hasItemSelected = typeof filteredItemIndex === 'number';
222-
setCursor(hasItemSelected ? filteredItemIndex : -1);
223-
}, [filteredItemIndex]);
221+
const hasItemSelected = typeof focusedItemIndex === 'number';
222+
setCursor(hasItemSelected ? focusedItemIndex : -1);
223+
}, [focusedItemIndex]);
224224

225225
useEffect(() => {
226226
if (isOpen && cursor >= 0) {

0 commit comments

Comments
 (0)