Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quill Editor - Focus

Tags:

html

quill

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?

like image 394
jj008 Avatar asked Jul 23 '18 23:07

jj008


People also ask

How do I get the content of Quill editor?

Many options exist to get HTML content from Quill editor. You can try to convert Delta with a JavaScript library: Quill Delta to HTML Converter. Solutions on Stack Overflow.

What is Quill editor?

Quill is a free, open source WYSIWYG editor built for the modern web. With its modular architecture and expressive API, it is completely customizable to fit any need.

How do I destroy the Quill editor?

Copy the contents of the quill instance, destroy the DOM element that the instance is bound to, create a new DOM element and paste the contents back in. Use disable via the API as you've already tried, but also style disabled Quill instances to not show any differentiation between Quill's formatting and your own.


1 Answers

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()
like image 55
Rusty Avatar answered Sep 20 '22 01:09

Rusty