Skip to content

Commit

Permalink
Merge pull request #1831 from ashfaqnisar/master
Browse files Browse the repository at this point in the history
Fixed the issue with the searchAlwaysOpen when using debounce
  • Loading branch information
wdh2100 committed Feb 20, 2022
2 parents d276d6a + 2101b1d commit d6fe822
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 d6fe822

Please sign in to comment.