diff --git a/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts b/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts index b175eb77c7e..0c3c21ecf0f 100644 --- a/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts +++ b/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts @@ -22,6 +22,7 @@ import { VTable, Position, contains, + isCtrlOrMetaPressed, } from 'roosterjs-editor-dom'; const TABLE_CELL_SELECTOR = 'td,th'; @@ -210,7 +211,10 @@ export default class TableCellSelection implements EditorPlugin { this.tableSelection = false; } }); - } else if (this.editor.getSelectionRangeEx()?.type == SelectionRangeTypes.TableSelection) { + } else if ( + this.editor.getSelectionRangeEx()?.type == SelectionRangeTypes.TableSelection && + (!isCtrlOrMetaPressed(event.rawEvent) || which == Keys.HOME || which == Keys.END) + ) { this.editor.select(null); } } diff --git a/packages/roosterjs-editor-types/lib/enum/Keys.ts b/packages/roosterjs-editor-types/lib/enum/Keys.ts index 17a0d4268d0..51dfd0e39bd 100644 --- a/packages/roosterjs-editor-types/lib/enum/Keys.ts +++ b/packages/roosterjs-editor-types/lib/enum/Keys.ts @@ -12,6 +12,8 @@ export const enum Keys { ESCAPE = 27, SPACE = 32, PAGEUP = 33, + END = 35, + HOME = 36, LEFT = 37, UP = 38, RIGHT = 39,