Opened 9 years ago
Closed 9 years ago
#14743 closed Bug (duplicate)
getSelectedCells() function in table tools plugin returns incorrect cell when selection is in the header of a nested table
Reported by: | goodaman | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.5.11 |
Keywords: | Cc: |
Description
Steps to reproduce
(This can be reproduced in the CKEditor Full Featured Demo)
- Create a table.
- Create a table inside a non-header row of the the first table, with a header row.
- Place the cursor in a cell in the header row of the nested table.
- Perform one of the Row commands available in the Table Tools plugin (e.g. Insert Rows Before, Insert Rows After, or Delete Rows)
Expected result
The header row in the nested table should be acted upon according to the chosen operation.
Actual result
The selected action is performed on a row of the outer table.
Other details (browser, OS, CKEditor version, installed plugins)
Tested in IE 11, Chrome 51, Firefox 47
Windows 7
CKEditor 4.5.9
Table Tools Plugin
There is a bug in the getSelectedCells()
function in the Table Tools plugin. Specifically, line 33:
var nearestCell = startNode.getAscendant( 'td', true ) || startNode.getAscendant( 'th', true );
When the selection is in a header row of a nested table, nearestCell will be a td
element of the outer table, since that is the first operation performed in the "or" statement. I believe the line should instead be:
var nearestCell = startNode.getAscendant( { td:1, th:1 }, true );
This will correctly select the nearest td
or th
element in the nested table.
Line 50 should be changed in the same manner.
Change History (2)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
DUP of #11192