Do not fire modifyend event when nothing was modified

This commit is contained in:
Andreas Hocevar
2022-01-11 12:04:56 +01:00
parent 866c641c87
commit 48ce451f53
2 changed files with 42 additions and 8 deletions

View File

@@ -1360,13 +1360,16 @@ class Modify extends PointerInteraction {
const evt = this.lastPointerEvent_;
this.willModifyFeatures_(evt, this.dragSegments_);
const removed = this.removeVertex_();
this.dispatchEvent(
new ModifyEvent(
ModifyEventType.MODIFYEND,
this.featuresBeingModified_,
evt
)
);
if (this.featuresBeingModified_) {
this.dispatchEvent(
new ModifyEvent(
ModifyEventType.MODIFYEND,
this.featuresBeingModified_,
evt
)
);
}
this.featuresBeingModified_ = null;
return removed;
}