Skip to content

Drag outside window #2075

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

Merged
merged 2 commits into from
Oct 10, 2017
Merged

Drag outside window #2075

merged 2 commits into from
Oct 10, 2017

Conversation

alexcjohnson
Copy link
Collaborator

document keeps getting mousemove events even outside the window, until mouseup. Who knew?!? Not me anyway... but now that I do, this quick change allows dragging to keep going outside the window. Tested manually in all my local browsers, IE9 - 11 and iOS on Browserstack, and of course the test suites still work (after removing mouseout which is no longer part of the interaction).

Two notes:

  • I kept coverSlip around, because that's an easy way to prevent selecting text as you drag around.
  • Some tips say you need to use setCapture / releaseCapture in IE, but a) that seems to be older versions than we target, and b) might have been mitigated by coverSlip anyway. I saw no difference if I included it in our code.
  • I included the IE polyfills in test_dashboard, commented out, to make it easier to test down to IE9 in the future.

cc @etpinard

@etpinard
Copy link
Contributor

Looks good to me.

I'm curious though, what made you investigate document mouse events on drag in the first place?

@alexcjohnson
Copy link
Collaborator Author

Looks good to me.

is that a 💃 ?

I'm curious though, what made you investigate document mouse events on drag in the first place?

Just noticed that google maps allows dragging like that and wondered how 🤔

@etpinard
Copy link
Contributor

etpinard commented Oct 10, 2017

💃

I asked the question in case we could have locked down some behavior in a meaningful test.

@alexcjohnson alexcjohnson merged commit 5e8777b into master Oct 10, 2017
@alexcjohnson alexcjohnson deleted the drag-outside-window branch October 10, 2017 14:19
@alexcjohnson
Copy link
Collaborator Author

I asked the question in case we could have locked down some behavior in a meaningful test.

I thought about that a little and didn't see anything. Our own mouse_event helper will fail outside the window (document.elementFromPoint returns null) so I don't really see a way to trigger the browser's internal behavior.

Fortunately the new behavior is actually simpler on our side than the old, as it doesn't need to worry about mouseOut.

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