{
- if (!container.contains(/** @type {HTMLElement} */ (e.target))) {
+ onpointerdown={(e) => {
+ if (!container.contains((e.target as HTMLElement))) {
preserve_editor_focus = false;
}
}}
- on:message={(e) => {
+ onmessage={(e) => {
if (preserve_editor_focus && e.data.type === 'iframe_took_focus') {
editor_view.focus();
}
@@ -228,11 +234,11 @@
{
+ onfocusin={() => {
clearTimeout(remove_focus_timeout);
preserve_editor_focus = true;
}}
- on:focusout={() => {
+ onfocusout={() => {
// Heuristic: user did refocus themmselves if iframe_took_focus
// doesn't happen in the next few miliseconds. Needed
// because else navigations inside the iframe refocus the editor.