You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Update model if text changesthis.quill.on('text-change',(delta,oldDelta,source)=>{lethtml=this.$refs.editor.children[0].innerHTML// <-- THIS LINEconsole.log(html)constquill=this.quillconsttext=this.quill.getText()if(html==='<p><br></p>')html=''this._content=htmlthis.$emit('input',this._content)this.$emit('change',{ html, text, quill })})
If a browser extension (for example LanguageTool) prepends some DOM Element to .ql-container, this line of code above will refer to wrong Element.
LanguageTool makes this:
<divclass="quill-editor ql-container ql-snow" content=""><!-- This Element is prepended by LanguageTool Extension --><lt-highlighterstyle="z-index: 1;" contenteditable="false"><lt-divspellcheck="false" class="lt-highlighter__wrapper" style="width: 914px; height: 591.2px;"><canvasclass="lt-highlighter__canvas" style="margin-top: 0px !important; margin-left: 0px !important;" width="914" height="591"></canvas></lt-div></lt-highlighter><!-- this.$refs.editor.children[0] will refer to lt-highlighter element now instead of div.ql-editor --><divclass="ql-editor ql-blank" data-gramm="false" data-placeholder="Текст сообщения..." spellcheck="false" contenteditable="true"><p><br></p></div><divclass="ql-clipboard" tabindex="-1" contenteditable="true"></div><divclass="ql-tooltip ql-hidden"><aclass="ql-preview" target="_blank" href="about:blank"></a><inputtype="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL"><aclass="ql-action"></a><aclass="ql-remove"></a></div></div>
Suggested solution:
// Update model if text changesthis.quill.on('text-change',(delta,oldDelta,source)=>{lethtml=this.$refs.editor.querySelector(".ql-editor").innerHTML// <-- change 108 line like this // this.$refs.editor refers to div.quill-editor.ql-container.ql-snowconsole.log(html)constquill=this.quillconsttext=this.quill.getText()if(html==='<p><br></p>')html=''this._content=htmlthis.$emit('input',this._content)this.$emit('change',{ html, text, quill })})
The text was updated successfully, but these errors were encountered:
line 108 in file src/editor.vue
If a browser extension (for example LanguageTool) prepends some DOM Element to
.ql-container
, this line of code above will refer to wrong Element.LanguageTool makes this:
Suggested solution:
The text was updated successfully, but these errors were encountered: