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

ClassicTestEditor initializaton flow is not the same as ClassicEditor #2893

Closed
oskarwrobel opened this issue Jul 5, 2018 · 3 comments · Fixed by ckeditor/ckeditor5-core#138
Assignees
Labels
package:core type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@oskarwrobel
Copy link
Contributor

In the ClassicTestEditor editableElement is created in the class constructor, so it is available before the plugins initialization https://github.com/ckeditor/ckeditor5-core/blob/eb43b632faa036041e58c917204819955beec6e6/tests/_utils/classictesteditor.js#L41

In the ClassicEditor editableElement is created in ClassicEditorUI#init() that is after plugins initialization.

What's the difference?

When you use editableElement in the Plugin#constructor or Plugin#init then ClassicEditor will throw but ClassicTestEditor won't.

This is an example, all unit tests of BalloonToolbar are green, but MT throws: https://github.com/ckeditor/ckeditor5-ui/issues/424

@oskarwrobel
Copy link
Contributor Author

oskarwrobel commented Jul 5, 2018

@oleq
Copy link
Member

oleq commented Jul 5, 2018

I think we agreed in the past that we don't reference (UI) View#element in constructors but in init(). So it's not a big deal that CTE works that way but as in https://github.com/ckeditor/ckeditor5-ui/issues/424 we have to remember about that when developing new plugins.

@oskarwrobel
Copy link
Contributor Author

Plugin#init() is still before the EditorUI#init().

@oleq oleq self-assigned this Jul 5, 2018
oleq referenced this issue in ckeditor/ckeditor5-core Jul 5, 2018
oskarwrobel referenced this issue in ckeditor/ckeditor5-core Jul 5, 2018
Fix: The `ClassicTestEditor` should not render its UI in the `constructor()`. Closes #137.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-core Oct 9, 2019
@mlewand mlewand added this to the iteration 19 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. package:core labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:core type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants