Merge pull request #7097 from J-Michalek/fix/editor-broken-toolbar-buttons

fix(editor): broken color buttons after modelValue update
pull/7064/merge
Tuğçe Küçükoğlu 2025-01-15 10:05:48 +03:00 committed by GitHub
commit b01abbf429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View File

@ -322,7 +322,7 @@ export default {
this.bindDocumentDragEndListener();
}
if (this.closeOnEscape) {
if (this.closeOnEscape && this.closable) {
this.bindDocumentKeyDownListener();
}
},

View File

@ -19,7 +19,7 @@
<button class="ql-italic" type="button" v-bind="ptm('italic')"></button>
<button class="ql-underline" type="button" v-bind="ptm('underline')"></button>
</span>
<span :key="reRenderColorKey" class="ql-formats" v-bind="ptm('formats')">
<span class="ql-formats" v-bind="ptm('formats')">
<select class="ql-color" v-bind="ptm('color')"></select>
<select class="ql-background" v-bind="ptm('background')"></select>
</span>
@ -64,16 +64,10 @@ export default {
extends: BaseEditor,
inheritAttrs: false,
emits: ['text-change', 'selection-change', 'load'],
data() {
return {
reRenderColorKey: 0
};
},
quill: null,
watch: {
modelValue(newValue, oldValue) {
if (newValue !== oldValue && this.quill && !this.quill.hasFocus()) {
this.reRenderColorKey++;
this.renderValue(newValue);
}
},