Do not fire modifystart when nothing is being modified

This commit is contained in:
Andreas Hocevar
2021-06-17 10:48:25 +02:00
parent 93b5ec9d43
commit 94a7cdba10
2 changed files with 39 additions and 9 deletions

View File

@@ -435,14 +435,17 @@ class Modify extends PointerInteraction {
}
}
}
this.dispatchEvent(
new ModifyEvent(
ModifyEventType.MODIFYSTART,
this.featuresBeingModified_,
evt
)
);
if (this.featuresBeingModified_.getLength() === 0) {
this.featuresBeingModified_ = null;
} else {
this.dispatchEvent(
new ModifyEvent(
ModifyEventType.MODIFYSTART,
this.featuresBeingModified_,
evt
)
);
}
}
}