ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

left-align button always removes the class

Open instruccionesaldorso opened this issue 7 years ago • 8 comments

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

instruccionesaldorso avatar Jul 18 '17 09:07 instruccionesaldorso

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.

msamsel avatar Jul 20 '17 07:07 msamsel

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.

instruccionesaldorso avatar Jul 21 '17 07:07 instruccionesaldorso

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.

msamsel avatar Aug 29 '17 09:08 msamsel

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?

guaguasi avatar Oct 12 '17 20:10 guaguasi

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.

msamsel avatar Oct 13 '17 07:10 msamsel

Hello folks! Any news related to this issue?

idmarjr avatar Jan 02 '18 16:01 idmarjr

@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.

mlewand avatar Mar 21 '18 12:03 mlewand

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 ;)

jean-louis avatar Feb 12 '20 18:02 jean-louis