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

Calling create() more than once on an element completely freezes the browser #746

Closed
thedavidmeister opened this issue Dec 24, 2017 · 5 comments
Assignees
Labels
type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@thedavidmeister
Copy link

thedavidmeister commented Dec 24, 2017

🐞 Is this a bug report or feature request? (choose one)

  • Bug report

πŸ’» Version of CKEditor

alpha2

πŸ“‹ Steps to reproduce

  1. call create more than once on an element

βœ… Expected result

nothing happens, or a warning, or an error

❎ Actual result

browser completely freezes

πŸ“ƒ Other details that might be useful

https://codepen.io/anon/pen/NXbvMV?editors=1111

@Mgsy
Copy link
Member

Mgsy commented Jan 2, 2018

I can reproduce this issue. It's reproducible only for InlineEditor and BalloonEditor. ClassicEditor loads properly. cc @Reinmar

@Reinmar
Copy link
Member

Reinmar commented Jan 2, 2018

We know about this issue. It's caused by both editors overriding each other's changes. This is actually... the expected result for us. It means that everything works fine.

But I understand that this may be awful to debug for developers. We need to add some checks – e.g. mark elements (with data-* attrs) on which editor was created and throw when trying to create one on already marked element.

@Reinmar Reinmar added candidate:1.0.0 type:improvement This issue reports a possible enhancement of an existing feature. labels Jan 2, 2018
@Reinmar Reinmar changed the title calling create more than once on an element completely freezes the browser Calling create() more than once on an element completely freezes the browser Jan 2, 2018
@Reinmar Reinmar mentioned this issue Jan 4, 2018
@oleq
Copy link
Member

oleq commented Jan 19, 2018

Classic editors work fine because they create own root editables. The issue occurs in Inline and Balloon because the instances share pre-existing DOM elements and use them as editables.

Anyway, do you think https://github.com/ckeditor/ckeditor5-ui/issues/176 could solve the issue? Would it work with asynchronous editors, e.g. the creation of the first one had started but it hasn't set any CSS class yet, while another one is about to be created and since there's no class (or attribute, whatever...) it starts using the same DOM element? Or is a complete edge case?

@Reinmar
Copy link
Member

Reinmar commented Jan 19, 2018

It must be done synchronously and immediately, otherwise, it will not be a reliable check. So it needs to be done by the core – possibly by the editor utils (since the base Editor doesn't know about the element now).

@Reinmar Reinmar added this to the next milestone Jul 18, 2018
@mlewand mlewand modified the milestones: next, iteration 26 Jun 28, 2019
@oleq oleq assigned oleq and unassigned pomek Jul 19, 2019
jodator added a commit to ckeditor/ckeditor5-core that referenced this issue Jul 23, 2019
Feature: Introduced a `secureSourceElement()` utility that prevents from initialising more than one editor on the same DOM element. See ckeditor/ckeditor5#746.
jodator added a commit to ckeditor/ckeditor5-editor-balloon that referenced this issue Jul 23, 2019
Other: Introduced a check that prevents sharing source elements between editor instances. See ckeditor/ckeditor5#746.
jodator added a commit to ckeditor/ckeditor5-editor-inline that referenced this issue Jul 23, 2019
Other: Introduced a check that prevents sharing source elements between editor instances. See ckeditor/ckeditor5#746.
jodator added a commit to ckeditor/ckeditor5-editor-decoupled that referenced this issue Jul 23, 2019
Other: Introduced a check that prevents sharing source elements between editor instances. See ckeditor/ckeditor5#746.
@mlewand mlewand closed this as completed Jul 23, 2019
@jodator
Copy link
Contributor

jodator commented Jul 23, 2019

Closed by: ckeditor/ckeditor5-core@6a59058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

7 participants