froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.28k stars 672 forks source link

Ongoing issue with backspace #4463

Closed thenitai closed 2 years ago

thenitai commented 2 years ago

Reported for v3 already, but still exists in v4.

You can replicate it with the editor on your homepage.

  1. Type "this is a test".
  2. Insert the word "new" to have a sentence like " this is a new test".
  3. Go to the end of the line.
  4. Hit backspace.

Result: The cursor jumps before the word "test" and starts removing from there.

Since seeing is believing:

2022-06-15_17-41-24 (1)

Krisell commented 2 years ago

I'm hoping/expecting this will be fixed very quickly. It was easy to reproduce and even after typing more text, erasing jumps to the wrong place.

thenitai commented 2 years ago

I'm hoping/expecting this will be fixed very quickly. It was easy to reproduce and even after typing more text, erasing jumps to the wrong place.

Good luck with that. The Froala team notoriously disregards any comments on here or hardly ever replies. I guess customers that don't pay for support anymore are not good customers to them.

JeppeKnockaert commented 2 years ago

Seems to be related to the 'url' plugin, disabling that one solves the issue for me.

Krisell commented 2 years ago

Seems to be related to the 'url' plugin, disabling that one solves the issue for me.

That explains why we don't see this error in our use case, thanks for this info!

JeppeKnockaert commented 2 years ago

So I investigated this a little further, these are my conclusions:

It gets caused by the insertion of the marker and the subsequent regex match that prevents the deletion of the marker if the text isn't a URL.

This snippet of minified code in url.min.js: l.markers.insert();var n=l.$el.find(".fr-marker");if(!t.textContent.match(/(^| |\u00

The issue doesn't happen instead of adding the word "new" in "this is a new test" (see reproducible case above), you add a url, e.g. "this is a github.com test"

This code was introduced in v4.0.12

El-Tommy commented 2 years ago

This error is also occurring when pressing Shift+Enter keys, with no plugin loaded.

By pressing backspace it deletes the content before the text.

https://user-images.githubusercontent.com/84974439/175315334-42f439e9-e297-4d03-9e30-668c6f618aba.mov

ilyaskarim commented 2 years ago

The fix will be available in the next editor release which is expected to be released by the late third week of this month

ilyaskarim commented 2 years ago

Fixed in V4.0.14 https://froala.com/wysiwyg-editor/changelog/#4.0.14

natikgadzhi commented 2 years ago

@ilyaskarim no, this issue is not resolved.