[update 89966] 富文本组件:解决火狐浏览器格式刷异常
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user