Skip to content

Commit

Permalink
#2060 - fix redundant actions on mouse events when not over canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Permiakov authored and Stanislav Permiakov committed Jan 10, 2023
1 parent 79907a3 commit 35c91bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/ketcher-react/src/script/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,15 @@ function domEventSetup(editor: Editor, clientArea) {
}
const EditorTool = editor.tool()
editor.lastEvent = event
if (EditorTool && eventName in EditorTool) {
if (
EditorTool &&
eventName in EditorTool &&
clientArea.contains(event.target)
) {
EditorTool[eventName](event)
return true
}
if (eventName === 'mouseup') {
if (eventName === 'mouseup' && editor.selection()) {
editor.selection(null)
}
return true
Expand Down

0 comments on commit 35c91bb

Please sign in to comment.