Skip to content

Commit

Permalink
[BUGFIX] Manipulate DOM in a setTimeout on dragStart (#681)
Browse files Browse the repository at this point in the history
An old known Chrome bug happens sometimes when the DOM is manipulated on dragStart event and the dragEnd fires immediately.
The solution is to add a setTimeout of 10 milliseconds into the handler and manipulate the DOM in that timeout.

Resolves: #680
  • Loading branch information
webian authored Aug 1, 2023
1 parent 1dcac8d commit 0bb621d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Resources/Public/JavaScript/FrontendEditing.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,15 @@ define([

$('.t3-frontend-editing__right-bar').fadeOut('fast');

var $iframe = F.iframe();
$iframe.contents()
.find('.t3-frontend-editing__dropzone[data-tables]')
.addClass('t3-frontend-editing__dropzone-hidden');
$iframe.contents()
.find('body')
.addClass('dropzones-enabled');
setTimeout(function displayDropZones() {
var $iframe = F.iframe();
$iframe.contents()
.find('.t3-frontend-editing__dropzone[data-tables]')
.addClass('t3-frontend-editing__dropzone-hidden');
$iframe.contents()
.find('body')
.addClass('dropzones-enabled');
}, 10);
},

dragCeEnd: function (ev) {
Expand Down

0 comments on commit 0bb621d

Please sign in to comment.