7
votes

Whenever I create another instance of the editor (in my case, through an onkeypress event), I lose focus on the editor I was typing on when the new editor is created. How can I prevent all editors from losing focus on any event?

2

2 Answers

6
votes

Quill has a method called focus() for this.

var quill = new Quill('#editor', {
  theme: 'snow'
});

// This will focus the instance of quill editor
quill.focus()
2
votes
setTimeout(() => { 
  quill.focus();
})

It will work