-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table copied from Google Sheets is specified as 0px wide in the editor #13746
Comments
I was able to reproduce this issue, however for me, it was not dependent on general HTML support, but on the table column resize plugin. With table column resize plugin I got result described above: Screen.Recording.2023-03-27.at.14.57.19.movAfter removing table column resize (still with general HTML support included in the build) I got: Screen.Recording.2023-03-27.at.14.59.15.movHowever, I got another issue with general HTML support. Just having this plugin in the build did not cause any problems. Only after adding config for this plugin, for example allow all: htmlSupport: {
allow: [
{
name: /.*/,
attributes: true,
classes: true,
styles: true
}
]
} I got error and nothing was pasted: Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
at setAttributeOnItem (writer.ts:1810:1)
at Writer.setAttribute (writer.ts:543:1)
at preserveElementAttributes (table.ts:107:1)
at dispatcher.on.priority (table.ts:91:1)
at UpcastDispatcher.fire (emittermixin.ts:241:1)
at UpcastDispatcher._convertItem (upcastdispatcher.ts:264:1)
at UpcastDispatcher._convertChildren (upcastdispatcher.ts:314:1)
at Object.convertChildren (upcastdispatcher.ts:174:1)
at UpcastDispatcher.<anonymous> (upcasthelpers.ts:941:1)
at UpcastDispatcher.fire (emittermixin.ts:241:1) I checked everything on latest |
@FilipTokarski Thank you for looking! Yes, I get the same "TypeError: Cannot read properties of null (reading 'getAttribute')" when allowing name: /.*/, in htmlSupport. We have TableColumnResize temporarily removed due to #13492 so I'm seeing the zero-width pastes without that plugin. In our environment, if I remove BOTH the GeneralHtmlSupport AND TableProperties plugins, I'm able to paste from Sheets, albeit getting a table that ignores the Sheets column widths and fills the editor window. I'll correct above where I called out just GeneralHtmlSupport, because disabling ONLY GeneralHtmlSupport and leaving TableProperties enabled does NOT allow pasting for me, either. Our htmlSupport config is:
These are the plugins we have enabled: |
Quick tip (without reading the thread): We changed a lot in how tables, colgroup/col, GHS (see #11479), and column resize work together. But since the alpha releases (of the OSS part of the project) are out already you can actually test those changes. |
@Reinmar I tested with 37.0.0-alpha.3 (displays 37.0.0-alpha.2 for CKEDITOR_VERSION), and see the same misbehavior described above. |
I checked it on
Steps to reproduce in manual tests:
htmlSupport: {
allow: [
{
name: /^(table|thead|tbody|td|th|tr|col|colgroup)$/,
styles: true,
},
],
},
Result: When you then comment out Error in the console seems like a separate issue here. It happens when GHS config allows for everything - described in one of my previous comments. |
The issue possibly is caused by
Scope:
|
Decided to split the issue. GHS crash will be done in this issue: #13876 |
Woohoo! |
Yes, this is gonna be a part of the next release 😊 |
📝 Provide detailed reproduction steps (if any)
✔️ Expected result
The table is visible in the editor.
❌ Actual result
The table is not visible (except for elongated borders), because it is zero width.
In the test editor above, it is zero width because the figure element wrapping the table specifies width: 0px:
figure class="table ck-widget ck-widget_with-selection-handle ck-widget_selected" style="width:0px;" contenteditable="false" data-placeholder="Type or paste your content here!"
In version 35.4.0, it is the table element itself that specifies width:0px:
table style="border-collapse:collapse;border-style:none;font-family:Arial;font-size:10pt;table-layout:fixed;width:0px;"
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: