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

Triple-click inside image caption causes error in Firefox #7542

Closed
garyapps opened this issue Jul 3, 2020 · 5 comments · Fixed by #7599
Closed

Triple-click inside image caption causes error in Firefox #7542

garyapps opened this issue Jul 3, 2020 · 5 comments · Fixed by #7599
Assignees
Labels
browser:firefox package:image type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.

Comments

@garyapps
Copy link

garyapps commented Jul 3, 2020

📝 Provide detailed reproduction steps (if any)

  1. Launch Firefox browser. (Do not use Chrome browser).
  2. Go to CKEditor Images documentation page
  3. Scroll down to the Image Captions section ( direct link )
  4. Look at the image with a caption "Autumn fields by Aleksander Nowodziński".
  5. Triple-click inside the caption anywhere on the caption text (click 3 times very fast). Normally doing a triple-click should select all the text.
  6. Instead you will see an error in the console. Also you will now be unable to select that image (meaning you can hover over it and see a yellow outline, but if you click it you will not get a blue outline). In fact you will not be able to select the other image in the editor either (the one without a caption), so it appears that the selection tool stops working after the error happens.
  7. Try again, this time using Chrome browser. No error in Chrome; caption text gets selected correctly.

✔️ Expected result

Clicking 3 times in a row should select all the caption text.
If you use Chrome that is what will happen.
But if you use Firefox you will get an error in the console.

❌ Actual result

You get an error in the console:

CKEditorError: model-selection-range-intersects: Trying to add a range that intersects with another range in the selection. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/…port/error-codes.html#error-model-selection-range-intersects
 {"addedRange":{"start":{"root":"main","path":[1],"stickiness":"toNext"},"end":{"root":"main","path":[2],"stickiness":"toPrevious"}},"intersectingRange":{"start":{"root":"main","path":[1,0,0],"stickiness":"toNone"},"end":{"root":"main","path":[1,0,0],"stickiness":"toNone"}}}

Also, after this error happens it is not possible to select the image. It is also not possible to select the image that is after it (the one without a caption). In other words the selection tool stops working.

📃 Other details

  • Browser: Firefox
  • OS: Win 10
  • CKEditor version: 20
  • Installed CKEditor plugins: …

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@garyapps garyapps added the type:bug This issue reports a buggy (incorrect) behavior. label Jul 3, 2020
@FilipTokarski
Copy link
Member

Hi, thanks for this report. I confirm this bug. It happens generally in image captions, event in empty ones. Only in Firefox. It's a regression introduced in the lates iteration, in v19 it works ok.

@FilipTokarski FilipTokarski added browser:firefox package:image type:regression This issue reports a bug that was not present in the previous releases. labels Jul 6, 2020
@Reinmar Reinmar added this to the next milestone Jul 6, 2020
@Reinmar
Copy link
Member

Reinmar commented Jul 7, 2020

@FilipTokarski, could you bisect this issue?

@FilipTokarski
Copy link
Member

824d731

@Reinmar
Copy link
Member

Reinmar commented Jul 7, 2020

Thanks. But the result didn't make it any simpler unfortunately :D In fact, it's a big WTH but makes some minimal sense.

@garyapps
Copy link
Author

garyapps commented Jul 7, 2020

I wonder if this is somehow connected to the other bug report I filed - Video element breaks widget functionality in Firefox #7525

At first glance they seem like very different issues - this one is related to triple clicking in a caption, whereas that one is related to clicking a video - but both bugs happen only in Firefox, they are both related to figure elements, and also both bugs result in the selection tool breaking after which all other widgets becoming un-selectable.

@niegowski niegowski modified the milestones: next, iteration 34 Jul 9, 2020
@niegowski niegowski self-assigned this Jul 9, 2020
oleq added a commit that referenced this issue Jul 10, 2020
Fix (widget): Triple-clicking inside an image caption should not crash the editor in Firefox. Closes #7542.

Fix (widget): Triple-clicking a link inside an image caption should not crash the editor in Safari. Closes #6021.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:firefox package:image type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants