change(ui) - assist filters change on type
This commit is contained in:
parent
06ba41b938
commit
3e5d5ca4fc
1 changed files with 4 additions and 2 deletions
|
|
@ -26,10 +26,12 @@ function FilterAutoCompleteLocal(props: Props) {
|
|||
icon = null,
|
||||
} = props;
|
||||
const [showModal, setShowModal] = useState(true)
|
||||
const [query, setQuery] = useState(value);
|
||||
const [query, setQuery] = useState(value);
|
||||
const debounceOnSelect = React.useCallback(debounce(props.onSelect, 500), []);
|
||||
|
||||
const onInputChange = ({ target: { value } }) => {
|
||||
setQuery(value);
|
||||
debounceOnSelect(null, { value });
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -53,7 +55,7 @@ function FilterAutoCompleteLocal(props: Props) {
|
|||
<input
|
||||
name="query"
|
||||
onChange={ onInputChange }
|
||||
onBlur={ onBlur }
|
||||
// onBlur={ onBlur }
|
||||
onFocus={ () => setShowModal(true)}
|
||||
value={ query }
|
||||
autoFocus={ true }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue