Skip to content

Commit

Permalink
persis the search event
Browse files Browse the repository at this point in the history
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
  • Loading branch information
Nexucis committed Feb 8, 2022
1 parent 14b2daa commit 46031b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ui/react-app/src/components/SearchBar.tsx
Expand Up @@ -13,6 +13,9 @@ const SearchBar: FC<SearchBarProps> = ({ handleChange, placeholder }) => {

const handleSearchChange = (e: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {
clearTimeout(filterTimeout);
// TODO e.persist() should be removed once the upgrade to react v17 is done.
// https://reactjs.org/docs/legacy-event-pooling.html
e.persist();
filterTimeout = setTimeout(() => {
handleChange(e);
}, 300);
Expand Down

0 comments on commit 46031b7

Please sign in to comment.