FIX 编辑器在el-drawer中,编辑器的弹框无法获得焦点

This commit is contained in:
sc 2022-08-08 17:45:52 +08:00
parent c0e8d7d35a
commit 31ecae89e4
1 changed files with 13 additions and 1 deletions

View File

@ -72,6 +72,7 @@
statusbar: true,
plugins: this.plugins,
toolbar: this.toolbar,
toolbar_mode: 'sliding',
font_size_formats: '12px 14px 16px 18px 22px 24px 36px 72px',
height: this.height,
placeholder: this.placeholder,
@ -100,7 +101,18 @@
editor.on('init', function() {
this.getBody().style.fontSize = '14px';
})
editor.on('OpenWindow', function(e) {
//FIX el-drawer
var D = document.querySelector('.el-drawer.open')
var E = e.target.editorContainer
if(D && D.contains(E)){
var nowDA = document.activeElement
setTimeout(()=>{
document.activeElement.blur()
nowDA.focus()
},0)
}
})
}
},
contentValue: this.modelValue