Skip to content

Conversation

@davidstubbs
Copy link
Contributor

Previously the user-select hack is applied whenever mouseDown on an
element matching the selector, with the right kind of click.

If the onStart method returns false then the drag is aborted, but
the user-select hack is still applied. Because the drag is not running,
the hack is not unapplied on mouseUp. This leads to a whole series of
";user-select: none;; user-select: none;; ..." appearing on the body tag
and the inability to select text on the page until a valid drag happens.

This commit moves the hack application to after the last short circuit
to ensure dragging is actually happening before disabling selection.

I've added a test case and also a box on the example page.

Previously the user-select hack is applied whenever mouseDown on an
element matching the selector, with the right kind of click.

But if the onStart method returns false then the drag is aborted, but
the user-select hack is still applied. Because the drag is not running
the hack is not unapplied on mouseUp. This leads to a whole series of
";user-select: none;; user-select: none;; ..." appearing on the body tag
and the inability to select text on the page until a valid drag happens.

This commit moves the hack application to after the last short circuit
to ensure dragging is actually happening.
@STRML
Copy link
Collaborator

STRML commented Apr 20, 2016

Nice work! I've seen this bug before but didn't have the time to track it down. Solid PR, and thanks for not committing built files.

@STRML STRML merged commit fcf80e1 into react-grid-layout:master Apr 20, 2016
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.

2 participants