Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue with the searchAlwaysOpen when using debounce #1831

Merged
merged 1 commit into from Feb 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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