diff --git a/dist/PublicLab.Editor.js b/dist/PublicLab.Editor.js index 4e04a1d3..12409132 100644 --- a/dist/PublicLab.Editor.js +++ b/dist/PublicLab.Editor.js @@ -22816,6 +22816,13 @@ module.exports = function CustomInsert(_module, wysiwyg) { } } }); + + // to hide the popover on pressing esc button + $(document).on("keydown", (e) => { + if (popoverIsOpen && e.key === "Escape") { + $(".woofmark-command-insert").click(); + } + }); }); }; diff --git a/src/modules/PublicLab.CustomInsert.js b/src/modules/PublicLab.CustomInsert.js index 45ff7f3f..b071931c 100644 --- a/src/modules/PublicLab.CustomInsert.js +++ b/src/modules/PublicLab.CustomInsert.js @@ -125,5 +125,12 @@ module.exports = function CustomInsert(_module, wysiwyg) { } } }); + + // to hide the popover on pressing esc button + $(document).on("keydown", (e) => { + if (popoverIsOpen && e.key === "Escape") { + $(".woofmark-command-insert").click(); + } + }); }); };