-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Avoid using preventDefault on mousedown #1782
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
Conversation
As long as the mousedown event does not have preventDefault, dragging out of an iframe works as expected.
| if (e.type === 'mousedown') { | ||
| L.DomEvent.on(document, 'mouseout', this._onUp, this); | ||
| } | ||
| this._userSelect = L.DomEvent._suppressUserSelect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to save a handle here instead of keeping it as a global private property in DomEvent?
|
There were existing methods for that already, just perhaps not as complete: https://github.com/Leaflet/Leaflet/blob/master/src/dom/DomUtil.js#L120-L135 |
|
Fixed in 60476da. |
|
Needs some more browser testing and we're good to go. |
|
Decided to merge this already because it fit really well into #1783. I think there will be not much problems with it but lets check on IE at least before release. |
|
@jfirebaugh unfortunately had to add peventDefault back as this change completely broke dragging in Firefox. |
As described in d3/d3#1289 and d3/d3#1322, this produces better drag behavior in iframes. I borrowed the method for supressing text selection from there as well.