froala/wysiwyg-editor

editor.commands.bold() doesn't disable bold formatting

Opened this issue · 0 comments

lepult commented
Expected behavior.

In the following jsfiddle, Ctrl+C toggles the bold formatting, by calling editor.commands.bold(). When the shortcut is used to disable bold formatting, newly typed text shouldn't be bold.

Actual behavior.

After using the shortcut to disable bold formatting, the formatting is still bold when you continue typing. You can see that the corresponding toolbar-button is deactivated, when using the shortcut, but when you continue typing, it is reactivated.

The same thing happens with other formatting options like italic, underline and strikeThrough.

Steps to reproduce the problem.

Using the jsfiddle: https://jsfiddle.net/1uqzvfpg/20/

  1. Press Ctrl+C to toggle the bold formatting
  2. Write a few characters in the Editor
  3. Press Ctrl+C to toggle the bold formatting
  4. Write a few characters

After Step 3, the bold toolbar-button, is deactivated. Despite that, the text is typed with bold formatting on step 4.

Editor version.

4.1.2

OS.

Windows 11

Browser.

The steps can be reproduced in Chrome and Edge. In Firefox editor.commands.bold() works as expected.

Recording.

The shortcut is pressed at 00:04 when the bold toolbar-button activates and 00:12 when the bold toolbar-button deactivates.

Aufzeichnung.2023-09-25.161722.mp4