Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem toggling bold/italics tag when there is a new line #29

Open
daevid66 opened this issue Oct 8, 2020 · 5 comments
Open

Problem toggling bold/italics tag when there is a new line #29

daevid66 opened this issue Oct 8, 2020 · 5 comments

Comments

@daevid66
Copy link

daevid66 commented Oct 8, 2020

How to reproduce:

  1. Go to the demo page: https://nenadpnc.github.io/cl-editor/
  2. Scroll to the "Custom action example"
  3. Place cursor somewhere in the placeholder text and pressing enter, moving some of the text to a new line.
  4. Select the new line, and make it bold. This works as expected...
  5. .But you cannot toggle off the bold, nothing happens when you click the button.
    image

It seems like it's somehow connected to the div tags that are created when you press enter. Possibly a work-around would be to only add br tags when pressing enter.

@daevid66
Copy link
Author

daevid66 commented Oct 8, 2020

Oh, forgot to say, except for this problem it's a really nice component!

@nenadpnc
Copy link
Owner

Hi @daevid66 , just tried to reproduce bug following your instructions, but no luck. I can toggle bold text on/off without an issue. Tested on Chrome v86, MacOS Catalina.
Problem may be that library uses document.executeCommand underneath, which heavily depends on browser vendor/version implementation of this command.
Implementing it this way keeps the lib lightweight, but on the downside bugs like this can surface out due to inconsistencies in browsers implementations.

@daevid66
Copy link
Author

Hi, sorry for not including my browser spec. I'm using Chrome (Version 85.0.4183.102) on windows 10.

Tested in Firefox now and the use case works fine there.

/David

@daevid66
Copy link
Author

Updated Chrome to version 86.0.4240.75 now, but I am sorry to say that the problem still exists.

/David

@aam-git
Copy link
Contributor

aam-git commented Dec 1, 2021

Just tested in here windows 10 Version 96.0.4664.45 (Official Build) (64-bit) and it seems to work...

EDIT: oops didn't notice the date you submitted this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants