Fix JS error when clicking an item in a filter list
parent
f28b0a33bc
commit
be6d98ba1a
|
@ -129,14 +129,12 @@ export function FilterList({
|
||||||
value={text}
|
value={text}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
ref={searchBoxRef}
|
ref={searchBoxRef}
|
||||||
// onChange={filterUpdate}
|
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
if (!exiting) {
|
if (!exiting && searchBoxRef.current) {
|
||||||
searchBoxRef.current!.focus();
|
searchBoxRef.current.focus();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onKeyUp={(e) => {
|
onKeyUp={(e) => {
|
||||||
// console.log("Key up", / e);
|
|
||||||
if (onKeyPress) {
|
if (onKeyPress) {
|
||||||
onKeyPress(e.key, text);
|
onKeyPress(e.key, text);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +205,7 @@ export function FilterList({
|
||||||
}}
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
exiting = true;
|
||||||
onSelect(option);
|
onSelect(option);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue