-
-
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
Support col[span]
and pt
s in paste from excel
#14720
Support col[span]
and pt
s in paste from excel
#14720
Conversation
This case is still not working: #14521 (comment) |
CI failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me looks good✅
…ll-widths-in-paste-from-excel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution, just few minor remarks and we're good to go.
packages/ckeditor5-table/src/tablecolumnresize/tablecolumnresizeediting.ts
Show resolved
Hide resolved
packages/ckeditor5-table/tests/tablecolumnresize/tablecolumnresizeediting.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's merge it once CI passes.
|
||
// Fill the array with 'auto' values if the number of columns is higher than number of declared values. | ||
columnWidths = Array.from( { length: columnsCount }, ( _, index ) => columnWidths[ index ] || 'auto' ); | ||
|
||
if ( columnWidths.length != columnElements.length || columnWidths.includes( 'auto' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not triggering column width normalization for such case:
<table>
<colgroup>
<col style="width: 30pt;">
<col style="width: 70pt;">
</colgroup>
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
</tbody>
</table>
And the final table ends up like this:
<figure class="table">
<table class="ck-table-resized">
<colgroup>
<col style="width:30%;">
<col style="width:70%;">
</colgroup>
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
</tbody>
</table>
</figure>
so pt
values are treated as they would be %
, the table gets full page width and the original sizes are not preserved.
The column width is normalized in post-fixer (but should be normalized before post-fixers are triggered).
Suggested merge commit message (convention)
Fix (table,paste-from-office): Tables pasted from MS Excel will have proper column widths. Closes #14521. Closes #14516.
Additional information
See the detailed explanation what is going on here.
There's also another PR that should be merged after this one: https://github.com/cksource/ckeditor5-commercial/pull/5399.