jj008
jj008

Reputation: 1083

Quill Editor - Focus

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?

Upvotes: 10

Views: 13384

Answers (2)

Karthika U
Karthika U

Reputation: 61

setTimeout(() => { 
  quill.focus();
})

It will work

Upvotes: 6

Ikhlak S.
Ikhlak S.

Reputation: 9034

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()

Upvotes: 12

Related Questions