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

Putting Indent in plugins array before specific plugins breaks the plugin #2359

Closed
Mgsy opened this issue Oct 1, 2019 · 2 comments · Fixed by ckeditor/ckeditor5-indent#20
Assignees
Labels
package:indent type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Mgsy
Copy link
Member

Mgsy commented Oct 1, 2019

Originally reported here - https://github.com/ckeditor/ckeditor5-build-decoupled-document/issues/24.

It looks like position of some plugins in the editor's plugins array has an impact on Indent functionality and indentCommand.isEnabled is always false.

After adding Indent to the build and keeping this plugins order:

ClassicEditor.builtinPlugins = [
    Essentials,
    Indent,
    IndentBlock,
    Paragraph
]

Indent plugin won't work. But, if we put Paragraph before Indent, it will work:

ClassicEditor.builtinPlugins = [
    Essentials,
    Paragraph,
    Indent,
    IndentBlock
]

The same thing occurs if Paragraph and Heading plugins are loaded, but in this case, the position of Paragraph plugin doesn't have any impact on Indent in favour of Heading.

Will work:

ClassicEditor.builtinPlugins = [
	Essentials,
	Heading,
	Indent,
	IndentBlock,
	Paragraph
];

Won't work:

ClassicEditor.builtinPlugins = [
	Essentials,
	Indent,
	IndentBlock,
	Heading,
	Paragraph
];

cc @jodator @Reinmar @mlewand

@jodator
Copy link
Contributor

jodator commented Oct 1, 2019

We should move extending schema to afterInit() to fix this:

https://github.com/ckeditor/ckeditor5-indent/blob/172d1978b1561ee8bd9f68ea7c69944af653b8b7/src/indentblock.js#L58-L62

right now it is done in init() and other plugins defines schema in init() method. It's a bug as we should remember (that was me here) to extend/rely on schema checks to be done in afterInit() calls.

@jodator jodator self-assigned this Oct 1, 2019
@jodator
Copy link
Contributor

jodator commented Oct 1, 2019

It's a 15 min change TBH so I'm adding this to current iteration.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-indent Oct 9, 2019
@mlewand mlewand added this to the iteration 27 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. package:indent labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:indent type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants