Unlock search suggestions properly, possibly fix safari

This commit is contained in:
Cadence Ember 2023-02-10 23:13:01 +13:00
parent c8401c972c
commit 0b858cf426
Signed by: cadence
GPG key ID: BC1C2C61CF521B17

View file

@ -74,7 +74,7 @@ effect(() => {
})
})
document.addEventListener("pageshow", () => {
window.addEventListener("pageshow", () => {
st.value = "ready" // unlock results from changing after returning to page
})
@ -88,4 +88,12 @@ render(html`<${SuggestionInput} />`, eInput)
// form focus
eForm.addEventListener("focusin", () => focus.value = true)
eForm.addEventListener("focusout", () => focus.value = false)
eForm.addEventListener("focusout", event => {
if (eForm.contains(event.relatedTarget)) {
// event fired when changing from one form element to the other
focus.value = true
} else {
// event fired when moving out of the form element
focus.value = false
}
})