Skip to content

Commit

Permalink
Merge pull request #1510 from microsoft/u/juliaroldi/image-selection-bug
Browse files Browse the repository at this point in the history
Fix for image selection
  • Loading branch information
juliaroldi authored Jan 18, 2023
2 parents 27e6907 + fd553f9 commit b30b4f2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ export default class ImageSelection implements EditorPlugin {
}
}
break;
case PluginEventType.MouseDown:
const mouseTarget = event.rawEvent.target;
const mouseSelection = this.editor.getSelectionRangeEx();
if (
mouseSelection &&
mouseSelection.type === SelectionRangeTypes.ImageSelection &&
mouseSelection.image !== mouseTarget
) {
this.editor.select(null);
}
break;
case PluginEventType.KeyUp:
const key = event.rawEvent.key;
const keyDownSelection = this.editor.getSelectionRangeEx();
Expand Down

0 comments on commit b30b4f2

Please sign in to comment.