niuware / mui-rte

Material-UI Rich Text Editor and Viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Applying styles to entire block does not work the first time around

morgan-tr opened this issue · comments

When an entire "block" is selected and then a style is applied (e.g. making the block bold or in italics), the entire block is deselected and the style does not apply. It only works the second time around.

Reproduction steps:

  1. Go to this Code Sandbox example
  2. Type some text
  3. Select the entire text
  4. Click the Bold button in the toolbar
  5. Note that the text is deselected and no style is applied
  6. Select the same text again
  7. Click the Bold button in the toolbar again
  8. Note that now the bold style applies

Expected behaviour

The bold style should apply the first time the Bold button is clicked.

Please note that the Bold button works fine if only part of the block is selected. It's only when an entire block is selected that the style need to be applied twice to take effect.

This happens on both version 1.29.0 and version ^2.0.0.