fix(tui): check for selected text instead of any selection in dialog escape handler (#16779)

This commit is contained in:
Kyle Altendorf
2026-03-16 20:25:03 -04:00
committed by GitHub
parent d7093abf61
commit a64f604d54

View File

@@ -70,7 +70,7 @@ function init() {
useKeyboard((evt) => {
if (store.stack.length === 0) return
if (evt.defaultPrevented) return
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()) return
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()?.getSelectedText()) return
if (evt.name === "escape" || (evt.ctrl && evt.name === "c")) {
const current = store.stack.at(-1)!
current.onClose?.()