Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new drag handle sometimes doesn't work #680

Closed
webian opened this issue Jul 31, 2023 · 2 comments · Fixed by #681
Closed

The new drag handle sometimes doesn't work #680

webian opened this issue Jul 31, 2023 · 2 comments · Fixed by #681

Comments

@webian
Copy link
Collaborator

webian commented Jul 31, 2023

In some cases clicking on top of the new drag handle doesn't start the dragging.
Clicking on the bottom always work.

Initially I thought that it was because the drag zone didn't cover the handle icon entirely:
psiggmbt

But even fixing that didn't fix this bug.

Also, adding
console.log('dragstart begin');
at the begin of dragCeStart JS function and
console.log('dragstart end');
at the end of that same function, do display the messages in the console so the function is executed but the drag doesn't start.

@webian webian changed the title The drag zone doesn't cover the handle icon entirely The new drag handle sometimes doesn't work Jul 31, 2023
@webian
Copy link
Collaborator Author

webian commented Jul 31, 2023

Debugging more I found out that the problem is that in those cases the dragCeEnd function is called immediately after dragCeStart so dragCeEnd function immediately removes class dropzones-enabled from the body making it seem as if the drag never begins.

@webian
Copy link
Collaborator Author

webian commented Aug 1, 2023

It is a know 10 years old Chrome bug.

It happens sometimes when the DOM is manipulated on dragStart event then dragEnd fires immediately.
The solution is to add a setTimeout of 10 milliseconds into the handler and manipulate the DOM in that timeout.

webian added a commit to webian/frontend_editing that referenced this issue Aug 1, 2023
…hrome bug

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: FriendsOfTYPO3#680
webian added a commit to webian/frontend_editing that referenced this issue Aug 1, 2023
…hrome bug

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: FriendsOfTYPO3#680
webian added a commit to webian/frontend_editing that referenced this issue Aug 1, 2023
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: FriendsOfTYPO3#680
MattiasNilsson pushed a commit that referenced this issue Aug 1, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant