diff --git a/src/shell/components/FieldTypeTinyMCE/index.tsx b/src/shell/components/FieldTypeTinyMCE/index.tsx index a577209f8a..7585851ed8 100644 --- a/src/shell/components/FieldTypeTinyMCE/index.tsx +++ b/src/shell/components/FieldTypeTinyMCE/index.tsx @@ -202,7 +202,6 @@ export const FieldTypeTinyMCE = React.memo(function FieldTypeTinyMCE({ "socialmediaembed", "imageresizer", ], - // NOTE: premium plugins are being loaded from a self hosted location // specific to our application. Making this component not usable outside of our context. external_plugins: externalPlugins ?? {}, @@ -313,6 +312,15 @@ export const FieldTypeTinyMCE = React.memo(function FieldTypeTinyMCE({ setIsSkinLoaded(true); }); + editor.on("keydown", (evt: any) => { + if (evt.key === "Escape") { + if (editor.plugins.fullscreen.isFullscreen()) { + editor.execCommand("mceFullScreen"); + evt.preventDefault(); + } + } + }); + // Limits the content width to 640px when in fullscreen editor.on("FullscreenStateChanged", (evt: any) => { if (evt.state) {