Skip to content

Commit

Permalink
fix: moveNewHandle should call endHandler with success: false when th…
Browse files Browse the repository at this point in the history
…e measurement is removed by `anyHandleOutsideImage` check (#1328)
  • Loading branch information
dannyrb authored Nov 18, 2020
1 parent d9a2c2b commit 8a261a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/manipulators/moveNewHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ function _moveEndHandler(
) {
const eventData = evt.detail;
const { element, currentPoints } = eventData;
let moveNewHandleSuccessful = true;

if (options.hasMoved === false) {
return;
Expand Down Expand Up @@ -289,6 +290,7 @@ function _moveEndHandler(
anyHandlesOutsideImage(evt.detail, annotation.handles)
) {
annotation.cancelled = true;
moveNewHandleSuccessful = false;
removeToolState(element, toolName, annotation);
}

Expand All @@ -301,7 +303,7 @@ function _moveEndHandler(
moveEndHandler,
},
doneMovingCallback,
true
moveNewHandleSuccessful
);
}

Expand Down

0 comments on commit 8a261a2

Please sign in to comment.