Add escape key to prevent keyboard trap inside description editor

This commit is contained in:
DianaXWiki 2025-03-17 17:37:31 +02:00
parent eaf55e01cd
commit 75c0bf0d26

View File

@ -498,6 +498,13 @@ define([
editor.setOption('readOnly', false);
cm.configureTheme(common, function () {});
editor.on("keydown", function (cm, event) {
if (event.key === "Escape") {
cm.getInputField().blur();
event.preventDefault();
}
});
var markdownTb = common.createMarkdownToolbar(editor);
$(code).prepend(markdownTb.toolbar);
$(markdownTb.toolbar).show();