Android: back button will close the keyboard

This commit is contained in:
Pieter Vander Vennet 2025-01-22 18:19:25 +01:00
parent 714bed7c51
commit e9c828a2c5
2 changed files with 11 additions and 1 deletions

View file

@ -10,7 +10,7 @@
import LoginToggle from "./Base/LoginToggle.svelte"
import Pencil from "../assets/svg/Pencil.svelte"
import Constants from "../Models/Constants"
import { Store, Stores, UIEventSource } from "../Logic/UIEventSource"
import { ImmutableStore, Store, Stores, UIEventSource } from "../Logic/UIEventSource"
import ThemesList from "./BigComponents/ThemesList.svelte"
import { MinimalThemeInformation } from "../Models/ThemeConfig/ThemeConfig"
import Eye from "../assets/svg/Eye.svelte"
@ -105,6 +105,14 @@
}
})
AndroidPolyfill.onBackButton((() => {
if(searchIsFocussed.data){
searchIsFocussed.set(false)
return true
}
return false
}), {returnToIndex: new ImmutableStore(false)})
/**
* Opens the first search candidate
*/

View file

@ -31,6 +31,8 @@
inputElement?.select()
}
})
}else if(document.activeElement === inputElement){
inputElement?.blur()
}
})