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

Move touchstart preventDefault to ol.renderer.dom.Map #2855

Merged
merged 2 commits into from
Oct 23, 2014

Conversation

fredj
Copy link
Member

@fredj fredj commented Oct 20, 2014

preventDefault is called to prevent the img context menu on mobile devices.

Fixes #2853

@fredj
Copy link
Member Author

fredj commented Oct 20, 2014

The changes included in this PR does not fixes the issue but minimize the problem: it now only occurs when the renderer is dom and on touch device.

@elemoine
Copy link
Member

Is it only for touch devices? I'm wondering about ie10 and the surface device. @oterral do you have any idea?

@oterral
Copy link
Contributor

oterral commented Oct 22, 2014

I can test. I'll give you the feedback this morning.

@fredj
Copy link
Member Author

fredj commented Oct 22, 2014

Thanks a lot @oterral. To test this, open the side-by-side example and long press the three maps: no context menu must appear.

@oterral
Copy link
Contributor

oterral commented Oct 22, 2014

LGTM tested on Surface/win 8.1/IE11 and PC/win 8/IE10

Long press on Surface triggers a contextmenu event so everthing works as before.

@fredj
Copy link
Member Author

fredj commented Oct 22, 2014

can we merge this one?

@elemoine
Copy link
Member

I think there is a goog.event.preventDefault static function that you can use as the listener.

@fredj fredj force-pushed the blur_preventDefault branch 3 times, most recently from e72cb7e to c613f65 Compare October 22, 2014 15:53
@fredj
Copy link
Member Author

fredj commented Oct 22, 2014

Good point, fixed.

@elemoine
Copy link
Member

Also, map renderers are disposable objects, so it may make sense to implement disposeInternal and unregisters the listener there. (Sorry that up just came up to me.)

`preventDefault` is called to prevent the img context menu on mobile devices.
@fredj
Copy link
Member Author

fredj commented Oct 23, 2014

Let's merge this!

fredj added a commit that referenced this pull request Oct 23, 2014
Move touchstart preventDefault to ol.renderer.dom.Map
@fredj fredj merged commit a6c3607 into openlayers:master Oct 23, 2014
@fredj fredj deleted the blur_preventDefault branch January 14, 2015 13:26
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.

blur event issue
3 participants