Opened 8 years ago

Closed 7 years ago

#14260 closed Bug (expired)

<table>-Widgets lose data-*-attributes when upcasted

Reported by: Johannes Spohr Owned by:
Priority: Normal Milestone:
Component: UI : Widgets Version:
Keywords: Cc:


I don't know if it's intended to use tables as widgets, but i have to do so in a project so I stumbled upon that.

Steps to reproduce

  1. Create a widget that is based on a table element
  2. Store the data in the downcast function as a data-* attribute
  3. Try to reload it in upcast

Expected result

Similar to div elements the data-* attributes should be in the attributes property of the element.

Actual result

They aren't, and the class attribute isn't too, so hasClass() also isn't working.

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

Tested with versions 4.5.4 to 4.5.6

Change History (4)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: table data attribute missing widgets removed
Status: newpending
Version: 4.5.6

Have you adjusted ACF for the widget -!/guide/widget_sdk_tutorial_1-section-adjusting-advanced-content-filter ?

It looks to me like classes are removed by ACF. Could you re-check and reply?

comment:2 Changed 8 years ago by Johannes Spohr

Well that actually seems to be the reason. Wasn't expecting that a table isn't allowed to have a class attribute. So it works when I use editor.filter.allow(...), but the rule isn't allowed when I just add the plugin. But thanks anyway!

comment:3 Changed 8 years ago by Jakub Ś

Wasn't expecting that a table isn't allowed to have a class attribute.

At the start plugins report to ACF what they want to use. In none of the plugins have reported class attribute for table than ACF will remove it.

Could you have a look one more time at!/guide/widget_sdk_tutorial_1-section-adjusting-advanced-content-filter and!/guide/widget_sdk_tutorial_1-section-limiting-available-formatting. It works as it is described in the tutorial so you might want to re-check your configuration.

Please make sure that you don't have some custom configuration which removes classes from tables? Have you perhaps used "allowedContent" in configuration instance or config.js? Please remember that!/api/CKEDITOR.config-cfg-allowedContent is used for defining what can be used in editor while!/api/CKEDITOR.config-cfg-extraAllowedContent defines what more can be used in editor.

comment:4 Changed 7 years ago by Jakub Ś

Resolution: expired
Status: pendingclosed
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