Problem/Motivation
When adding a CSS class to a table using Editor Advanced Table, the class attribute replaces the essential CKEditor widget classes on the figure wrapper element instead of being applied to the <table> element. This breaks the visual selection handles and widget functionality in the editing view.
Expected behavior:
<figure class="table ck-widget ck-widget_with-selection-handle">
<table class="my-custom-class">Actual behavior:
<figure class="my-custom-class">
<table>
Root Cause
When the CKEditor 5 Table Properties plugin is enabled, tables are wrapped in elements in the editing view. The downcast converter for the tableClass attribute uses mapper.toViewElement(), which returns the figure wrapper instead of the actual table element.
Using writer.setAttribute("class", ...) on the figure completely overwrites its existing classes ("table ck-widget ck-widget_with-selection-handle"), breaking the widget's visual functionality.
Issue fork editor_advanced_table-3559510
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 1.0.x
changes, plain diff MR !1
Comments
Comment #2
sergio morais commentedComment #3
sergio morais commentedComment #4
sergio morais commentedComment #5
sergio morais commentedComment #11
sergio morais commentedComment #13
sergio morais commented