Skip to content

Conversation

jfirebaugh
Copy link
Member

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.

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();
Copy link
Member

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?

@mourner
Copy link
Member

mourner commented Jun 24, 2013

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
Could we move the implementation there instead of having new _supressUserSelect names?

@jfirebaugh
Copy link
Member Author

Fixed in 60476da.

@mourner
Copy link
Member

mourner commented Jun 24, 2013

Needs some more browser testing and we're good to go.

@mourner mourner merged commit 60476da into master Jun 25, 2013
@mourner
Copy link
Member

mourner commented Jun 25, 2013

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.

mourner added a commit that referenced this pull request Jun 25, 2013
@mourner
Copy link
Member

mourner commented Jun 25, 2013

@jfirebaugh unfortunately had to add peventDefault back as this change completely broke dragging in Firefox.

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