stop select dialog event propagation

This commit is contained in:
Sebastian Herrlinger
2026-01-16 03:17:32 +01:00
parent 4af9defb89
commit 46be47d0be

View File

@@ -157,10 +157,26 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
const keybind = useKeybind() const keybind = useKeybind()
useKeyboard((evt) => { useKeyboard((evt) => {
if (evt.name === "up" || (evt.ctrl && evt.name === "p")) move(-1) if (evt.name === "up" || (evt.ctrl && evt.name === "p")) {
if (evt.name === "down" || (evt.ctrl && evt.name === "n")) move(1) evt.preventDefault()
if (evt.name === "pageup") move(-10) evt.stopPropagation()
if (evt.name === "pagedown") move(10) move(-1)
}
if (evt.name === "down" || (evt.ctrl && evt.name === "n")) {
evt.preventDefault()
evt.stopPropagation()
move(1)
}
if (evt.name === "pageup") {
evt.preventDefault()
evt.stopPropagation()
move(-10)
}
if (evt.name === "pagedown") {
evt.preventDefault()
evt.stopPropagation()
move(10)
}
if (evt.name === "return") { if (evt.name === "return") {
const option = selected() const option = selected()
if (option) { if (option) {