Skip to content

Commit

Permalink
Updated SelectionList onSelectRow's debounce to trailing edge if `sho…
Browse files Browse the repository at this point in the history
…uldDebounceRowSelect = true`
  • Loading branch information
huzaifa-99 committed Jun 24, 2024
1 parent 0b4812d commit 2957ec7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function BaseSelectionList<TItem extends ListItem>(
}, [onChangeText]);

// eslint-disable-next-line react-hooks/exhaustive-deps
const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 1000, {leading: true}), [onSelectRow]);
const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 200), [onSelectRow]);

/**
* Logic to run when a row is selected, either with click/press or keyboard hotkeys.
Expand Down

0 comments on commit 2957ec7

Please sign in to comment.