codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.92k stars 2.09k forks source link

focus #758

Open TomasLongo opened 5 years ago

TomasLongo commented 5 years ago

Hi,

is there a way to detect if the editor is in focus or blurred?

My use case is that i have multiple editors in my site and I want to display/hide certain control elements depending on if the editor is in focus.

Thanks, Tomas

CavalcanteLeo commented 4 years ago

I wanna know this too

hata6502 commented 4 years ago

https://github.com/codex-team/editor.js/pull/1224

2-towns commented 4 years ago

Yes it makes sense to have this feature. Looking for focus event is a common feature.

One use case would be to applied a css class to another HTML element when the editor is focused.

The PR of @hata6502 looks great, thank you. It's sad it wasn't accepted.