mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix some firefox mobile issue
This commit is contained in:
parent
fdc4fb996b
commit
d30812fe1b
@ -63,10 +63,14 @@ export const SearchControl = ({ clusterRef }) => {
|
||||
}))
|
||||
setTagsResults(tags.filter(tag => tag.id?.toLowerCase().includes(value.toLowerCase())))
|
||||
|
||||
|
||||
|
||||
}, 500, [value]);
|
||||
|
||||
const hide = async () => {
|
||||
setTimeout(() => {
|
||||
setHideSuggestions(true);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
const searchInput = useRef<HTMLInputElement>(null);
|
||||
|
||||
return (<>
|
||||
@ -77,11 +81,7 @@ export const SearchControl = ({ clusterRef }) => {
|
||||
ref={searchInput}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
onFocus={() => setHideSuggestions(false)}
|
||||
onBlur={async () => {
|
||||
setTimeout(() => {
|
||||
setHideSuggestions(true);
|
||||
}, 200);
|
||||
}} />
|
||||
onBlur={() => hide()} />
|
||||
<LocateControl />
|
||||
</div>
|
||||
{value.length > 0 && <button className="tw-btn tw-btn-sm tw-btn-circle tw-absolute tw-right-16 tw-top-2" onClick={() => setValue("")}>✕</button>}
|
||||
@ -108,10 +108,12 @@ export const SearchControl = ({ clusterRef }) => {
|
||||
if (filterTags.length > 0) {
|
||||
marker !== null && window.history.pushState({}, "", `/${item.layer.name}/${item.id}`)
|
||||
resetFilterTags();
|
||||
hide();
|
||||
}
|
||||
else {
|
||||
marker !== null && clusterRef?.current?.zoomToShowLayer(marker, () => {
|
||||
marker?.openPopup();
|
||||
hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user