[update 89966] 富文本组件:解决火狐浏览器格式刷异常

This commit is contained in:
danshihao
2024-09-19 09:26:57 +08:00
parent 4b063ce99b
commit e272308b0c
+7 -8
View File
@@ -38,13 +38,12 @@ export default {
},
// 解决火狐浏览器失去焦点后,下次获取焦点,会保留上次光标位置导致格式刷异常
editorBlur (e) {
// e.preventDefault()
e.target.blur()
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.blur()
setTimeout(() => {
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.blur()
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.focus()
}, 100)
this.$nextTick(() => {
setTimeout(() => {
UE.getEditor(this.id).body.blur()
UE.getEditor(this.id).body.focus()
}, 1)
})
}
},
props: {
@@ -110,7 +109,7 @@ export default {
})
},
beforeDestroy () {
UE.getEditor(this.id).removeEventListener('blur', this.editorBlur)
UE.getEditor(this.id).body.removeEventListener('blur', this.editorBlur)
},
destoryed () {
this.editor.destory()