Quill: Can we have OnFocus and OnBlur events?

Created on 17 Jan 2017  路  4Comments  路  Source: quilljs/quill

This isn't really an issue, but more of a request/suggestion. It would be quite useful to know when the editor is focused or not through listeners. Any possibility of this being added?

Platforms:

Mozilla Firefox, Windows 10

Version:

1.1.10

Most helpful comment

@benbro this hasn't had activity since you closed the issue while there is still very much a problem with your suggested solution.

In addition to what @wilk said... 8 months ago, there is no selection-change event when the editor is focused and the user clicks outside of the editor.

This is a rich text editor, HTML text inputs have focus & blur events. QuillJS should too.

All 4 comments

You can use the selection-change event.

A null range indicates selection loss (usually caused by loss of focus from the editor). You can also use this event as a focus change event by just checking if the emitted range is null or not.

@benbro unfortunately, selection-change is not triggered when the user clicks on the same row that has been selected.
this problem occurs when you focus on a certain node and then click inside the editor to loose the focus on the previous node: with selection-change this cannot be achieved if you click on the same selected row.

@benbro this hasn't had activity since you closed the issue while there is still very much a problem with your suggested solution.

In addition to what @wilk said... 8 months ago, there is no selection-change event when the editor is focused and the user clicks outside of the editor.

This is a rich text editor, HTML text inputs have focus & blur events. QuillJS should too.

@abramz please open a new issue with your explanation why selection-change event isn't enough to detect focus and blur with all the info requested in the issue template.

Was this page helpful?
0 / 5 - 0 ratings