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

[Firefox] Error when clicking on label elements inside editor #9635

Closed
FilipTokarski opened this issue May 6, 2021 · 7 comments · Fixed by #14706
Closed

[Firefox] Error when clicking on label elements inside editor #9635

FilipTokarski opened this issue May 6, 2021 · 7 comments · Fixed by #14706
Assignees
Labels
browser:firefox squad:core Issue to be handled by the Core team. squad:features Issue to be handled by the Features team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@FilipTokarski
Copy link
Member

FilipTokarski commented May 6, 2021

📝 Provide detailed reproduction steps (if any)

There are multiple ways to reproduce this ( see screencasts below ), example steps:

  1. Open Firefox and go to https://ckeditor.com/ckeditor-5/demo/
  2. Open image alternative balloon
  3. Click several times on label Text alternative

✔️ Expected result

Nothing Happens

❌ Actual result

Uncaught CKEditorError: Permission denied to access property Symbol.toStringTag
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-Permission denied to access property Symbol.toStringTag
    tr istext.js:17
    domSelectionToView domconverter.js:515
    _handleSelectionChange selectionobserver.js:145
    observe selectionobserver.js:104
    fire emittermixin.js:199
    i emittermixin.js:247
    attach emittermixin.js:202
    listenTo emittermixin.js:61
    observe selectionobserver.js:103
    attachDomRoot view.js:288
    init classiceditorui.js:104
    create classiceditor.js:193
    promise callback*create/< classiceditor.js:193
    create classiceditor.js:188
    A app-bb5ed7289d.js:33
    P app-bb5ed7289d.js:33
    q app-bb5ed7289d.js:33
    init app-bb5ed7289d.js:33
    default app-bb5ed7289d.js:44
    init app-bb5ed7289d.js:16
    EventListener.handleEvent* app-bb5ed7289d.js:16
    n app-bb5ed7289d.js:1
    <anonymous> app-bb5ed7289d.js:1
    <anonymous> app-bb5ed7289d.js:1
ckeditorerror.js:64:2

Screencasts

0_firefox1.mp4
0_firefox3.mp4
0_firefox2.mp4

📃 Other details

  • Browser: Firefox
  • Happens since version 24.0.0
  • It happens when I click inside forms, specifically on label elements, but only those that are inside editor - for example I cannot reproduce this when opening media embed toolbar dropdown and clicking on the label.

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

@FilipTokarski FilipTokarski added type:bug This issue reports a buggy (incorrect) behavior. browser:firefox squad:core Issue to be handled by the Core team. labels May 6, 2021
@scofalik
Copy link
Contributor

scofalik commented May 6, 2021

To me it looks like some sort of weird issue in Firefox.

From a quick research, it looks like it is connected with selection and inputs. As far as I can tell, the error does not occur when you click on texts in the version item (for example, author name).

The issue happens when you click on place next to an input. I think that Firefox messes up with selection then.

What happens is, Firefox set selection in a way that the selection is in the input but when you try to get a range from the selection and then start and end container of the range, Firefox returns "Restricted" object, which throws when any of its property is accessed:

image.png

When you check selection anchor and focus, correct DOM element is returned, but in line 512 "Restricted" object is returned.

AFAICS, this error does not have an impact on editor, i.e. editor works. Am I right?

image.png

What we could do is:

  1. Try to reproduce this using the most basic HTML possible and report the error to Firefox.
  2. Until it is fixed, we could either use try-catch or just use selection anchor and offset in this part of code (since this is just one range, using selection anchor and offset should be safe?).
  3. However, I guess there are other places where we use isText() that also might be affected by that.

@o-alquimista
Copy link

o-alquimista commented May 26, 2021

I just found another way to reproduce this, but it doesn't involve interacting with CKEditor at all. All you need is a CKEditor instance on the page. Ignore it. Leave it there. Focus on the rest of the form. Click randomly on any other <label> element on the page. Eventually, the error pops up. Very weird, right?

Captura de tela de 2021-05-25 22-14-07

In spite of the error, the editor works fine. This error doesn't break anything, as far as I can see.

@AhmedEzzat12
Copy link

Any update on this?

@scofalik
Copy link
Contributor

scofalik commented Sep 5, 2022

@AhmedEzzat12 Does this error in any way impact how your editor works?

@AhmedEzzat12
Copy link

@scofalik It freezes the whole UI for a few seconds and then it resumes, the problem is that it doesn't happen when interacting with the editor itself only but having at least one instance of it on the page is enough for the error to occur.
for a little context, I'm using it in react app.

@ovidiua2003
Copy link

Subscribe +1
This still happens randomly without even clicking the ckeditor just like o-alquimista said

@mlewand mlewand added squad:features Issue to be handled by the Features team. and removed squad:core Issue to be handled by the Core team. labels Jul 31, 2023
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Jul 31, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Aug 1, 2023
@illia-stv illia-stv added the squad:core Issue to be handled by the Core team. label Aug 21, 2023
niegowski added a commit that referenced this issue Aug 30, 2023
…n-label-elements-inside-editor

Fix (engine): Don't throw an error when clicking on a balloon with input on Firefox. Closes #9635.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Aug 30, 2023
@CKEditorBot CKEditorBot added this to the iteration 67 milestone Aug 30, 2023
@OrenMag
Copy link

OrenMag commented Apr 8, 2024

@scofalik It freezes the whole UI for a few seconds and then it resumes, the problem is that it doesn't happen when interacting with the editor itself only but having at least one instance of it on the page is enough for the error to occur. for a little context, I'm using it in react app.

Same here, we experience freezing after this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:firefox squad:core Issue to be handled by the Core team. squad:features Issue to be handled by the Features team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants