betancourtl / draft-js-custom-styles

Create custom inline styles for draft-js in a sane way
MIT License
34 stars 17 forks source link

Managing focus #10

Closed brandondurham closed 6 years ago

brandondurham commented 6 years ago

Thanks so much for such a great package. So super useful.

I had a question about managing focus. In the example you have in the current README.md, clicking any of the buttons or making a selection in the select menus steals focus away from the selected content and onto the element you clicked. Native browser behavior, but undesirable for a rich text editor. It does still apply the change to the previously-selected text, but you can no longer type or use keys to navigate the content until you manually click back into the editor.

I saw the “Managing Focus” documentation on the draft.js site. Is managing focus something you need to handle yourself or are there built-in methods for this?

Thank you!

betancourtl commented 6 years ago

Hey! yes managing focus is something that has to be managed by developer, The library is just in charge of creating the correct styles in the EditorState.