Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unfocus quill's text editor

Is there a way to unfocus?

I want to update the whole text format using my code and i don't want to give my user the option to write text after it. I update the format of the whole text (range: start=0, end=text length) using formatText method and then the text area on focus and the user can write:/

like image 332
user2975885 Avatar asked Dec 12 '15 23:12

user2975885


People also ask

How do I turn off Quill editor?

quill. disable() should do the trick.

How do I turn off react Quill editor?

in React Quill 1.3. 5, you can add the readOnly prop as true. It will disable your editor like input tag when disabled.


1 Answers

There is not an explicit unfocus() API since there's not much that Quill needs beyond the existing DOM blur function:

quill.root.blur()

The user can of course click back into the editor so if you want to prevent that you can disable the whole editor with:

quill.editor.disable()

You may still make API calls but the user will be unable to interact with the editor while disabled.

like image 66
jhchen Avatar answered Sep 29 '22 11:09

jhchen