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

bug fix to play nice with sencha touch 2.3 #2501

Merged
merged 1 commit into from Aug 7, 2014
Merged

Conversation

fredj
Copy link
Member

@fredj fredj commented Aug 7, 2014

We have included ol3 map in a sencha touch 2.3 mobile application. Within the mobile app, the map crash as soon as we click on it. We have been able to pin point the problem (and do a dummy fix) with the ol-whitespace.js file.

OL3 version: 3.0.0-beta.5
File: ol-whitespace.js

Line: 25856
var touch = event.changedTouches.item(0);
replaced by
var touch = event.changedTouches[0];

No more crash, the click event is now propagated successfully to the sencha app handlers.

@fredj
Copy link
Member

fredj commented Aug 7, 2014

Are you experimenting the same issue without sencha? eg. http://ol3js.org/en/master/examples/mobile-full-screen.html

This is weird; the item function is standard: https://developer.mozilla.org/en-US/docs/Web/API/TouchList.item

@fredj
Copy link
Member

fredj commented Aug 7, 2014

Sencha touch is probably building or changing the changedTouches property using a plain Array

@fredj fredj self-assigned this Aug 7, 2014
@elemoine
Copy link
Member

elemoine commented Aug 7, 2014

Sencha touch is probably building or changing the changedTouches property using a plain Array

Yes that's it, I've seen this in the past as well.

@fredj
Copy link
Member

fredj commented Aug 7, 2014

PR attached, please review

@tsauerwein
Copy link
Member

changedTouches is also used in the pointer events module, but there we use the array accessors [], so it is fine.

@fredj
Copy link
Member

fredj commented Aug 7, 2014

@tsauerwein ok, thanks for the info

@elemoine
Copy link
Member

elemoine commented Aug 7, 2014

+1 as long as using [] is the same as using the item function.

@fredj
Copy link
Member

fredj commented Aug 7, 2014

Yes it's the same: "You may also use standard array syntax to access items in the list."

@jadetr
Copy link
Author

jadetr commented Aug 7, 2014

Are you experimenting the same issue without sencha?
@fredj As expected by reading the comments here, without sencha everything works fine.

Fix quickly promoted in the main branch, nice job!
Next time I'll try to fork, dig in the source and push a fix :)

fredj added a commit that referenced this pull request Aug 7, 2014
bug fix to play nice with sencha touch 2.3
@fredj fredj merged commit 18b3c3e into openlayers:master Aug 7, 2014
@fredj fredj deleted the 2501 branch August 7, 2014 14:58
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.

None yet

4 participants