Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/changelog/entries/2026/06/8797.SUP-19968.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drag'n'drop: Eliminate a crash, leading to the undefined behaviour, when dropping an element to the unsupported or incorrectly set drop zone.
7 changes: 4 additions & 3 deletions src/plugins/common/block/lib/dragbehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,12 @@ define([
* element before or after this
*/
DragBehavior.prototype.onDragStop = function () {
// @todo check if the $overElement is a Valid element to drop the block
if (typeof this.$overElement === 'undefined' || !this.$overElement) {
return;
}
if (allowDropRegions(this.$overElement, this.$element) &&
this.$overElement.parent().length > 0) {
if (this.$overElement &&
!this._isAllowedOverElement(this.$overElement[0])) {
if (!this._isAllowedOverElement(this.$overElement[0])) {
this.enableInsertBeforeOrAfter(this.$overElement[0]);
// prevent dragging the block into a position, where it should not be
// when _isAllowedOverElement() return false, insertBeforeOrAfterMode must not be false
Expand Down