mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Clear search (#14655)
This commit is contained in:
parent
eb9dafc872
commit
ea96d95622
@ -42,6 +42,12 @@ export default function SearchFilter({
|
|||||||
setValue('');
|
setValue('');
|
||||||
onSubmit('');
|
onSubmit('');
|
||||||
};
|
};
|
||||||
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setValue(e.currentTarget.value);
|
||||||
|
if (e.currentTarget.value === '') {
|
||||||
|
onClear();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FilterContainer>
|
<FilterContainer>
|
||||||
@ -50,9 +56,7 @@ export default function SearchFilter({
|
|||||||
placeholder={Header}
|
placeholder={Header}
|
||||||
name={name}
|
name={name}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={e => {
|
onChange={handleChange}
|
||||||
setValue(e.currentTarget.value);
|
|
||||||
}}
|
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onClear={onClear}
|
onClear={onClear}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user