[update 89966] 富文本组件:解决火狐浏览器格式刷异常
This commit is contained in:
@@ -38,13 +38,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 解决火狐浏览器失去焦点后,下次获取焦点,会保留上次光标位置导致格式刷异常
|
// 解决火狐浏览器失去焦点后,下次获取焦点,会保留上次光标位置导致格式刷异常
|
||||||
editorBlur (e) {
|
editorBlur (e) {
|
||||||
// e.preventDefault()
|
this.$nextTick(() => {
|
||||||
e.target.blur()
|
setTimeout(() => {
|
||||||
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.blur()
|
UE.getEditor(this.id).body.blur()
|
||||||
setTimeout(() => {
|
UE.getEditor(this.id).body.focus()
|
||||||
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.blur()
|
}, 1)
|
||||||
this.$refs.editorBoxRef.querySelector('iframe').contentDocument.body.focus()
|
})
|
||||||
}, 100)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -110,7 +109,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
UE.getEditor(this.id).removeEventListener('blur', this.editorBlur)
|
UE.getEditor(this.id).body.removeEventListener('blur', this.editorBlur)
|
||||||
},
|
},
|
||||||
destoryed () {
|
destoryed () {
|
||||||
this.editor.destory()
|
this.editor.destory()
|
||||||
|
|||||||
Reference in New Issue
Block a user