From fc770ec3180c4ba86ccff070d3992fa7b935eea4 Mon Sep 17 00:00:00 2001 From: 776865656e Date: Wed, 11 Apr 2018 21:13:50 +0100 Subject: [PATCH] Don't autofocus on load If the editor has content upon initial load it will gain focus, which can cause unexpected page scrolling. This is because of using `.pasteHTML()` (which is just a wrapper around `.clipboard.dangerouslyPasteHTML()`) - doing it this way fixes the issue with autofocus. (Incidentally, credit for the fix goes to @jetzhou - see zenoamaro/react-quill#321) --- src/editor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.vue b/src/editor.vue index 46f7763..79aa604 100644 --- a/src/editor.vue +++ b/src/editor.vue @@ -86,7 +86,7 @@ // Set editor content if (this.value || this.content) { - this.quill.pasteHTML(this.value || this.content) + this.quill.setContents(this.quill.clipboard.convert(this.value || this.content)) } // Disabled editor