jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.41k stars 1.16k forks source link

Button states not consistent #171

Open axelson opened 7 years ago

axelson commented 7 years ago

The button states aren't always accurate until the user begins typing. So if I click bold and type then the bold button is depressed, but if I then click bold again the bold button stays depressed! But when I start typing again the bold button is no longer depressed and the text does not come out bold.

Checked on Google Chrome on the demo page: https://jpuri.github.io/react-draft-wysiwyg/

jpuri commented 7 years ago

@axelson: button gets highlighted if character before cursor has the style. I find it correct. Is the behavior you are noticing different from this. Can you share a recording ?

axelson commented 7 years ago

Yes that is the current behavior. But I find that wrong from a UX perspective. I think that the button state should reflect the style that the next character typed will have. This is similar to how Google Docs and Pages work. Otherwise after you type bold text if you press the bold button it stays depressed even though it did have an effect (which feels broken).