mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-21 16:14:45 +00:00
fix(tui): check for selected text instead of any selection in dialog escape handler (#16779)
This commit is contained in:
@@ -70,7 +70,7 @@ function init() {
|
|||||||
useKeyboard((evt) => {
|
useKeyboard((evt) => {
|
||||||
if (store.stack.length === 0) return
|
if (store.stack.length === 0) return
|
||||||
if (evt.defaultPrevented) 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")) {
|
if (evt.name === "escape" || (evt.ctrl && evt.name === "c")) {
|
||||||
const current = store.stack.at(-1)!
|
const current = store.stack.at(-1)!
|
||||||
current.onClose?.()
|
current.onClose?.()
|
||||||
|
|||||||
Reference in New Issue
Block a user