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

Touch event triggered twice on Android #48

Closed
fariazz opened this issue Jul 16, 2013 · 9 comments
Closed

Touch event triggered twice on Android #48

fariazz opened this issue Jul 16, 2013 · 9 comments

Comments

@fariazz
Copy link
Collaborator

fariazz commented Jul 16, 2013

Touch event on mobile is being triggered twice on Android. To test click on any of the numbers (tested on Android 4.1 browser), it will show the number twice:

http://static.pablofarias.com/racinggame2/

May have to do with the way I'm using the viewport. What I want to achieve is to fit to width of the device without showing more of the game world. Using maximize: "touch" shows a blank screen on my phone, using maximize: true, messes up the alignment of the GUI and the background (the link above only has the GUI. I'll be releasing the full game once finished in a blog post).

(basically I just want to re-scale the entire game to fit the screen, the way it happens in LimeJS for instance, without showing extra parts of the level)

@fariazz
Copy link
Collaborator Author

fariazz commented Jul 22, 2013

this seems to be an issue that was present in an early version of Crafty as well: http://craftyjs.tumblr.com/post/4601812926/0-4-2-released

@fariazz
Copy link
Collaborator Author

fariazz commented Jul 24, 2013

Tested in Chrome and FF on a Android 4.2 tablet and it works fine, although these browsers don't seem to support the viewport tag.

I think this is related to the viewport tag in some way.

@yckart
Copy link

yckart commented Jul 24, 2013

Mhh, it seems that there's a mistake in your code, I get this error message:

Uncaught TypeError: Cannot read property 'lists' of undefined 

@fariazz
Copy link
Collaborator Author

fariazz commented Jul 24, 2013

hi @yckart try the finished version of the game, it happens too and there are no errors: http://static.pablofarias.com/racinggamefinished/

@fariazz
Copy link
Collaborator Author

fariazz commented Jul 25, 2013

In my Android 4.2.2 tablet the bug occurs using the native Android browser. Using Chrome and FF is not observed. So far seen in the native browser in Android 2.3, 4.1 and 4.2.2.

@fariazz
Copy link
Collaborator Author

fariazz commented Mar 5, 2014

I get the impression this was solved here: thatpixguy@987fb8b but somehow never nade it to the main repo

@cykod
Copy link
Owner

cykod commented Mar 11, 2014

Problem with that solution was hasTouch is true for a whole bunch of desktop browsers - which then don't trigger the mouse events.

@fariazz
Copy link
Collaborator Author

fariazz commented Mar 11, 2014

You are right! didn't think of those Windows 8 "yoga" tablets :)

@ghost ghost added the bug label Jun 3, 2014
@fariazz
Copy link
Collaborator Author

fariazz commented Jun 24, 2014

It seems the issue is on the old Android browser only, at least it's not present on Android Chrome or FF and people who published to Android using Cordova haven't reported this issue.

New Android devices come with Chrome as the default browser so this issue is no longer present on those.

I don't like the idea to make a tweak for a particular browser that's not even used in newer devices. If we did something like this (#39 (comment)), developers who want to support this browser could easily turn mouse events off when on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants