perf: android表情输入框跟键盘同时出现的情况

This commit is contained in:
kuaifan 2023-03-17 20:22:08 +08:00
parent 528ea404ad
commit bbcec1dac2

View File

@ -425,10 +425,8 @@ export default {
}, },
// Watch disabled change // Watch disabled change
disabled(newVal) { disabled(val) {
if (this.quill) { this.quill?.enable(!val)
this.quill.enable(!newVal)
}
}, },
// Reset lists // Reset lists
@ -448,6 +446,13 @@ export default {
}, },
showEmoji(val) { showEmoji(val) {
if (this.emojiBottom) {
if (val) {
this.quill.enable(false)
} else if (!this.disabled) {
this.quill.enable(true)
}
}
if (val) { if (val) {
let text = this.value.replace(/ /g," ") let text = this.value.replace(/ /g," ")
text = text.replace(/<[^>]+>/g, "") text = text.replace(/<[^>]+>/g, "")
@ -626,7 +631,7 @@ export default {
// Instance // Instance
this.quill = new Quill(this.$refs.editor, this._options) this.quill = new Quill(this.$refs.editor, this._options)
this.quill.enable(false) this.quill.enable(!this.disabled)
// Set editor content // Set editor content
if (this.value) { if (this.value) {
@ -635,11 +640,6 @@ export default {
this.$emit('input', this.getInputCache()) this.$emit('input', this.getInputCache())
} }
// Disabled editor
if (!this.disabled) {
this.quill.enable(true)
}
// Mark model as touched if editor lost focus // Mark model as touched if editor lost focus
this.quill.on('selection-change', range => { this.quill.on('selection-change', range => {
if (!range) { if (!range) {