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())))
|
setTagsResults(tags.filter(tag => tag.id?.toLowerCase().includes(value.toLowerCase())))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, 500, [value]);
|
}, 500, [value]);
|
||||||
|
|
||||||
|
const hide = async () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
setHideSuggestions(true);
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
const searchInput = useRef<HTMLInputElement>(null);
|
const searchInput = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
return (<>
|
return (<>
|
||||||
@ -77,11 +81,7 @@ export const SearchControl = ({ clusterRef }) => {
|
|||||||
ref={searchInput}
|
ref={searchInput}
|
||||||
onChange={(e) => setValue(e.target.value)}
|
onChange={(e) => setValue(e.target.value)}
|
||||||
onFocus={() => setHideSuggestions(false)}
|
onFocus={() => setHideSuggestions(false)}
|
||||||
onBlur={async () => {
|
onBlur={() => hide()} />
|
||||||
setTimeout(() => {
|
|
||||||
setHideSuggestions(true);
|
|
||||||
}, 200);
|
|
||||||
}} />
|
|
||||||
<LocateControl />
|
<LocateControl />
|
||||||
</div>
|
</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>}
|
{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) {
|
if (filterTags.length > 0) {
|
||||||
marker !== null && window.history.pushState({}, "", `/${item.layer.name}/${item.id}`)
|
marker !== null && window.history.pushState({}, "", `/${item.layer.name}/${item.id}`)
|
||||||
resetFilterTags();
|
resetFilterTags();
|
||||||
|
hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
marker !== null && clusterRef?.current?.zoomToShowLayer(marker, () => {
|
marker !== null && clusterRef?.current?.zoomToShowLayer(marker, () => {
|
||||||
marker?.openPopup();
|
marker?.openPopup();
|
||||||
|
hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user