Skip to content

Commit

Permalink
Fix #1994: Do not do table or image selection in entity (#1995)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Aug 2, 2023
1 parent 457305f commit 1095411
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1095411

Please sign in to comment.