Opened 7 years ago

Last modified 7 years ago

#14880 confirmed Bug

One style with a class + another with two classes which one is used be the first style, then both are selected in style combo menu.

Reported by: masterdjon Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version:
Keywords: Cc:


Steps to reproduce

  1. Create two styles that both applies to the same elements (well in fact, it seems the problem maybe only related to the "image2" plugin. I can say so, because I have the same stuff for "table" element)
  2. One with one class. In example : fullWidth
  3. Second with two classes which one is the same as the first style.
  4. In the editor, add an image element that you set the style "Styles_Base_FullWidthWithoutLeftMargin"

Styles.js Example

    		name: $l('Styles_Base_FullWidthWithMargin'),
     		type: 'widget',
     		widget: 'image',
    		attributes: { 'class' : 'fullWidth' }
    		name: $l('Styles_Base_FullWidthWithoutLeftMargin'),
     		type: 'widget',
     		widget: 'image',
    		attributes: { 'class' : 'fullWidth outSectionBodyLeft' }

HTML example

	<span tabindex="-1" contenteditable="false" data-cke-widget-wrapper="1"
		class="cke_widget_wrapper cke_widget_inline cke_image_nocaption"
		data-cke-display-name="image" data-cke-widget-id="0" role="region"
		aria-label="Élément  image"><img alt="" height="500"
		data-cke-saved-src="IMAGE_URL_REMOVED" src="IMAGE_URL_REMOVED"
		width="1500" class="cke_widget_element outSectionBody fullWidth"
		data-cke-widget-upcasted="1" data-cke-widget-keep-attr="0"
		class="cke_reset cke_widget_drag_handler_container"
		style="background: url(&quot;URL_REMOVED/ckeditor/plugins/widget/images/handle.png&quot;) rgba(220, 220, 220, 0.498039); top: -15px; left: -20px; display: block;"><img
			class="cke_reset cke_widget_drag_handler"
			width="15" title="Cliquer et glisser pour déplacer" height="15"
			role="presentation" draggable="true"></span><span
		title="Cliquer et glisser pour redimensionner">&#8203;</span></span>

Expected result

Reopening the style combo show only the second style selected, not the first.

Actual result

Reopening the style combo show both styles selected.


This could resolved by looking at the classes in the combo that search via a regex which is set to full word. I didn't look the code, but as I saw in other issues, it seems that the editor splits the classes using a space to find the correlated style.

Other details (browser, OS, CKEditor version, installed plugins)

Not relevant except for the image2 plugin installed. Though, just saying the "$l" function is just a translating function of my own.

Change History (1)

comment:1 Changed 7 years ago by Jakub Ś

Status: newconfirmed
Version: 4.5.10

Yes, you are right - I have tried using same classes for tables and widgets. in case of widgets both classes are selected in dropdown when you aplly just Styles_Base_FullWidthWithoutLeftMargin. In tables only second class is selected.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy