Merge pull request #13219 from ahocevar/modify-delete-no-event

Do not fire modifyend event when nothing was modified
This commit is contained in:
Andreas Hocevar authored and GitHub committed 2022-01-11 13:56:08 +01:00
commit 1f761d943f
2 files changed
+42 -8

No files matched your search

+10 -7
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;
}