This changes should improve work of undo/redo available in draft-js.
Before this changes when you add red, then blue colors one by one and press Ctrl + Z you will see black color, only on second Ctrl + Z you will see red. The same for Ctrl + Y.
(It seems like this happen because editor state receive one change on remove and second on add, so it will better to act with content state and push change to editor only once when we add style)
This changes should fix this issue and you will see red color on first Ctrl + Z like expected.
Awesome! thank you for taking your time to submit a PR. I will take a look at it tonight and if all goes well I will merge this into the main repo and publish to NPM.
This changes should improve work of undo/redo available in draft-js.
Before this changes when you add red, then blue colors one by one and press Ctrl + Z you will see black color, only on second Ctrl + Z you will see red. The same for Ctrl + Y. (It seems like this happen because editor state receive one change on remove and second on add, so it will better to act with content state and push change to editor only once when we add style)
This changes should fix this issue and you will see red color on first Ctrl + Z like expected.