diff --git a/packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts b/packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts index 462df71d862..a0f6a871ac8 100644 --- a/packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts +++ b/packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts @@ -57,6 +57,7 @@ export default class ImageSelection implements EditorPlugin { const target = event.rawEvent.target; if ( safeInstanceOf(target, 'HTMLImageElement') && + target.isContentEditable && event.rawEvent.button === mouseLeftButton ) { this.editor.select(target); diff --git a/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/mouseUtils/handleMouseDownEvent.ts b/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/mouseUtils/handleMouseDownEvent.ts index 91e9f6f3b7b..b68a93cfd92 100644 --- a/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/mouseUtils/handleMouseDownEvent.ts +++ b/packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/mouseUtils/handleMouseDownEvent.ts @@ -24,7 +24,12 @@ export function handleMouseDownEvent( state: TableCellSelectionState, editor: IEditor ) { - const { which, shiftKey } = event.rawEvent; + const { which, shiftKey, target } = event.rawEvent; + const table = editor.getElementAtCursor('table', target as Node, event); + + if (table && !table.isContentEditable) { + return; + } const td = editor.getElementAtCursor(TABLE_CELL_SELECTOR); if (which == RIGHT_CLICK && state.tableSelection && state.vTable && td) {