From 31ecae89e49d5a992ffa7249ce47b2998edd0a9b Mon Sep 17 00:00:00 2001 From: sc Date: Mon, 8 Aug 2022 17:45:52 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E7=BC=96=E8=BE=91=E5=99=A8=E5=9C=A8el-dr?= =?UTF-8?q?awer=E4=B8=AD=EF=BC=8C=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=97=A0=E6=B3=95=E8=8E=B7=E5=BE=97=E7=84=A6?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scEditor/index.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/scEditor/index.vue b/src/components/scEditor/index.vue index 3e3e2522..7719035d 100644 --- a/src/components/scEditor/index.vue +++ b/src/components/scEditor/index.vue @@ -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