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
2022-01-11 13:56:08 +01:00
committed by GitHub
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;
}