From df8c074714f2c9c15ffb6d0a01be0ace44651e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 7 Feb 2024 00:41:31 +0800 Subject: [PATCH] Allow selecting text within editor tooltips --- assets/js/hooks/session.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/js/hooks/session.js b/assets/js/hooks/session.js index 807aec6d7..c70f8bfe6 100644 --- a/assets/js/hooks/session.js +++ b/assets/js/hooks/session.js @@ -461,6 +461,15 @@ const Session = { return; } + // If the click is inside an editor tooltip, exit insert mode to + // allow for text selection within the tooltip + if (event.target.closest(`.cm-tooltip`)) { + if (this.insertMode) { + this.setInsertMode(false); + } + return; + } + // When clicking an insert button, keep focus and insert mode as is. // This is relevant for markdown cells, since we show the markdown // preview in insert mode and exiting insert mode on mousedown would