fix: envinput crash on debounce handle editor undefined

This commit is contained in:
Andrew Bastin
2022-01-01 15:44:28 +05:30
parent 4770b86948
commit 314c0968b1

View File

@@ -120,10 +120,12 @@ export default defineComponent({
}, },
handleChange() { handleChange() {
this.debouncedHandler = debounce(function () { this.debouncedHandler = debounce(function () {
if (this.$refs.editor) {
if (this.internalValue !== this.$refs.editor.textContent) { if (this.internalValue !== this.$refs.editor.textContent) {
this.internalValue = this.$refs.editor.textContent this.internalValue = this.$refs.editor.textContent
this.processHighlights() this.processHighlights()
} }
}
}, 5) }, 5)
this.debouncedHandler() this.debouncedHandler()
}, },