|
|
|
|
@ -577,6 +577,11 @@ export const textWysiwyg = ({
@@ -577,6 +577,11 @@ export const textWysiwyg = ({
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleBlur = ()=>{ |
|
|
|
|
if(!document.hasFocus()) return ; |
|
|
|
|
handleSubmit(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const cleanup = () => { |
|
|
|
|
// remove events to ensure they don't late-fire
|
|
|
|
|
editable.onblur = null; |
|
|
|
|
@ -626,7 +631,7 @@ export const textWysiwyg = ({
@@ -626,7 +631,7 @@ export const textWysiwyg = ({
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Otherwise, re-enable submit on blur and refocus the editor.
|
|
|
|
|
editable.onblur = handleSubmit; |
|
|
|
|
editable.onblur = handleBlur; |
|
|
|
|
editable.focus(); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
@ -636,7 +641,7 @@ export const textWysiwyg = ({
@@ -636,7 +641,7 @@ export const textWysiwyg = ({
|
|
|
|
|
window.addEventListener("pointerup", bindBlurEvent); |
|
|
|
|
// handle edge-case where pointerup doesn't fire e.g. due to user
|
|
|
|
|
// alt-tabbing away
|
|
|
|
|
window.addEventListener("blur", handleSubmit); |
|
|
|
|
window.addEventListener("blur", handleBlur); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// prevent blur when changing properties from the menu
|
|
|
|
|
|