-
Notifications
You must be signed in to change notification settings - Fork 18
I/6521: Add check for heading columns in merge cells command. #306
Conversation
…for mergeability.
I've found an undo bug: ckeditor/ckeditor5#6634. Also on master so a separate ticket. |
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.
I would also add test like this:
it( 'should be false if selection has cells only from column headers and other cells - ???', () => {
setData( model, modelTable( [
[ '00[]', '01', '02', '03' ],
[ '10', '11', '12', '13' ]
], { headingColumns: 2, headingRows: 1 } ) );
tableSelection._setCellSelection(
root.getNodeByPath( [ 0, 0, 0 ] ),
root.getNodeByPath( [ 0, 1, 2 ] )
);
expect( command.isEnabled ).to.be.false;
} );
} | ||
|
||
const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 ); | ||
const columnIndexes = getColumnIndexes( tableCells ); |
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.
I know that this is not the scope of this PR but getColumnIndexes
confused me a little, maybe it should be sth like getFirstLastColumnIndexes
? Same for getRowIndexes
-> getFirstLastRowIndexes
.
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.
I know that this is not the scope of this PR
Yep, for me, it is outside a PR's scope. I'm fine with opening a new PR/issue for this. But here I didn't touch that code.
Co-Authored-By: Kuba Niegowski <1232187+niegowski@users.noreply.github.com>
Added this in 6c3ad1d kinda redundant but why not. |
Suggested merge commit message (convention)
Other: Merge cells command should not merge cells from heading columns with other cells. Closes ckeditor/ckeditor5#6521.