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

Fix for drag in scrolling container: set dropEffect to 'none' when canDrop is false #1131

Conversation

eaglus
Copy link
Contributor

@eaglus eaglus commented Sep 11, 2018

When dragging in scrolling container, drag cursor resets to 'move' after any scrolling because of this strange code

handleTopDragOver() {
....
} else if (this.checkIfCurrentDragSourceRectChanged()) {
  // Prevent animating to incorrect position.
  // Drop effect must be other than 'none' to prevent animation.
  e.preventDefault()
  e.dataTransfer.dropEffect = 'move'
}

Because of this, after scroll, drag cursor on drop targets, disabled for drop (or non-drop target elements) is shown as 'move' cursor, whereas it should be shown as 'disabled' cursor, because drop is disabled by application logic.
This behavior is very confusing for users.

@darthtrevino darthtrevino merged commit 7c255dc into react-dnd:master Nov 5, 2018
@eaglus eaglus deleted the fix-top-dragover-reset-dropeffect-to-none branch November 15, 2018 04:06
darthtrevino pushed a commit that referenced this pull request Feb 3, 2022
…nDrop is false (#1131)

* Set dropEffect to 'none' when canDrop is false. dropEffect should not depend on drag source rect (if drag source position has changed, dropEffect should be 'none' when drop is disabled).

* Remove unused code (we don't need to get/compare currentDragSourceNodeOffset anymore)

* revert lodash change
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 this pull request may close these issues.

None yet

2 participants