Skip to content

Commit

Permalink
Fixed the issue with the searchAlwaysOpen when using debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfaqnisar committed Dec 15, 2021
1 parent 5adcdbb commit 2101b1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plug-ins/DebounceSearchRender.js
Expand Up @@ -63,13 +63,17 @@ class _DebounceTableSearch extends React.Component {
}
};


render() {
const { classes, options, onHide, searchText, debounceWait } = this.props;

const debouncedSearch = debounce(value => {
this.props.onSearch(value);
}, debounceWait);

const clearIconVisibility = options.searchAlwaysOpen ? 'hidden' : 'visible';


return (
<Grow appear in={true} timeout={300}>
<div className={classes.main}>
Expand All @@ -89,7 +93,7 @@ class _DebounceTableSearch extends React.Component {
placeholder={options.searchPlaceholder}
{...(options.searchProps ? options.searchProps : {})}
/>
<IconButton className={classes.clearIcon} onClick={onHide}>
<IconButton className={classes.clearIcon} style={{ visibility: clearIconVisibility }} onClick={onHide}>
<ClearIcon />
</IconButton>
</div>
Expand Down

0 comments on commit 2101b1d

Please sign in to comment.