|
|
@@ -104,8 +104,12 @@ export default class RemoveRowCommand extends Command {
|
|
|
}
|
|
|
|
|
|
// Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
|
|
|
-function getCellToFocus( table, removedRow, columnToFocus ) {
|
|
|
- const row = table.getChild( removedRow );
|
|
|
+function getCellToFocus( table, removedRowIndex, columnToFocus ) {
|
|
|
+ let row = table.getChild( removedRowIndex );
|
|
|
+
|
|
|
+ if ( !row ) {
|
|
|
+ row = table.getChild( table.childCount - 1 );
|
|
|
+ }
|
|
|
|
|
|
// Default to first table cell.
|
|
|
let cellToFocus = row.getChild( 0 );
|