Skip to content

Commit

Permalink
Merge pull request #4936 from specify/issue-4931
Browse files Browse the repository at this point in the history
Recalculate WB search function when utils changes
  • Loading branch information
melton-jason authored May 20, 2024
2 parents b11bd49 + c50dfcd commit 68299d2
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions specifyweb/frontend/js_src/lib/components/WbUtils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@ export function WbUtilsComponent({
useBooleanState(true);

const handleSearch = React.useCallback(
_.debounce(
(event: React.KeyboardEvent<HTMLInputElement>) => {
if (searchRef.current && searchRef.current?.value.length > 0)
unclickSearch();
else clickSearch();
utils.searchCells(event, searchRef.current);
},
debounceRate,
false
),
[debounceRate]
_.debounce((event: React.KeyboardEvent<HTMLInputElement>) => {
if (searchRef.current && searchRef.current?.value.length > 0)
unclickSearch();
else clickSearch();
utils.searchCells(event, searchRef.current);
}, debounceRate),
[debounceRate, utils]
);

return (
Expand Down

0 comments on commit 68299d2

Please sign in to comment.