ckeditor4
ckeditor4 copied to clipboard
left-align button always removes the class
When using the justify plugin, button to "align left" removes any possible previous class for alignment. How could I force to add the class defined to left-align I defined in the "justifyClasses" for the YAML file? Thanks in advance, Sergio
Hi,
this issue seems to be a feature request, which will extend or modify way how justify plugin actually work. When left alignment is default one, then style is removed from text. Left styles are added and used in cases where text is written from right to left, and right alignment is default in such languages.
In case that there would be option to remain default alignment in text, then we need a little bit more info about the usage of it. Could you describe better your case maybe with some examples why this kind of feature is required? It would help us understand better this issue and your needs in this case.
A usecase: we have a website where we want all texts to be center-aligned by default. If no class is added to the paragraphs, we just added a css rule to align centered the text. But we want to support the case where the backend user is able through the editor to align certain content elements to the left.
Definition of done:
- user has possibility to define default justify styling which might be: left, right, centre, justify, which are not related to RTL settings of the editor.
- default class is never add to output result.
- user can force justify plugin to always add classes despite fact of setting default class.
What's the status on this? Is there a workaround? I have that exact use case. I'd expect that if a class is defined in the justifyClasses array that it should be applied period. Why have a class for the left align if it will never be used? Is the left justify class applied in RTL and right justify class removed?
Hi, currently behaviour is exactly as you describe. "Left" class is not added in LTR settings, because is treat as default one. Analogical situation is for "right" class in case of RTL setting. I'm not aware of any workaround, maybe someone from our community on Stack Overflow face with such issue and will be able to give you some solution.
Hello folks! Any news related to this issue?
@idmarjr not really, in case you'd like to see this issue being worked on, please add a 👍 reaction to the main post of this issue. This is one way to show us your interest on a given issue.
In case you have a premium support, let us know about the issue on the support channel, that will also bump the issue.
Hi, I've found a workaround for the same usecase described in this quote:
A usecase: we have a website where we want all texts to be center-aligned by default. If no class is added to the paragraphs, we just added a css rule to align centered the text. But we want to support the case where the backend user is able through the editor to align certain content elements to the left.
with the useComputedState value to false I could left-align a paragraph
edit: now I have the side-effect reported in issue #672, but better than nothing ;)