fix(tui): check for selected text instead of any selection in dialog escape handler (#16779)
This commit is contained in:
parent
d7093abf61
commit
a64f604d54
1 changed files with 1 additions and 1 deletions
|
|
@ -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?.()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue