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

Android (chrome): prev keypress is entered #379

Closed
Timmmy opened this issue Aug 13, 2015 · 8 comments
Closed

Android (chrome): prev keypress is entered #379

Timmmy opened this issue Aug 13, 2015 · 8 comments
Labels

Comments

@Timmmy
Copy link

Timmmy commented Aug 13, 2015

Hi!

I've noticed an issue in chrome on Android.
The keyboard inserts the previous stroke instead of current. Except for the first, that one is ok.

For example pressing abcd turns into aabc.
Any ideas?
Occurs on two different devices. Examples on the site van be used to reproduce.

Any ideas?

Thanks in advance!!

Tim

@Timmmy
Copy link
Author

Timmmy commented Aug 13, 2015

Just confirmed that it also occurs in Firefox for Android!
It also seems to be present in version 1.24.1

@Mottie
Copy link
Owner

Mottie commented Aug 13, 2015

Hi @Timmmy!

Hmm, to me it appears that the touch event is only showing the last key entered. So the first touch isn't entering anything.

For now, try setting the keyBinding option to 'touchstart' (default is 'mousedown touchstart') because internally the plugin is trying to prevent adding a value if both of those events fire, but I think it's preventing it from happening.

I'll try to spend more time investigating this issue when I get some free time today.

@Mottie Mottie added the Bug label Aug 13, 2015
@Timmmy
Copy link
Author

Timmmy commented Aug 13, 2015

Hi @Mottie,

Thanks for the quick reply.
Tried both mousedown only and touchstart only, but that doesn't fix the issue.

However I found this:
When you replace in jquery.keyboard.js: last.key = $key.attr('data-value');
With: last.key = $(this).attr('data-value');
=> Then it works correctly for all "normal keys" (but still an issue for enter, backspace,...);

When setting an alert after this line, it is clear that the one but last value goes into last.key. This also clarifies that the function is only called once, even with both bindings enabled.

Hope this gives you at least a clue?

Thanks in advance!

@Mottie
Copy link
Owner

Mottie commented Aug 13, 2015

Hmm, that is very odd.

$key should be the same as $(this) unless you're using the mouswheel, which shouldn't be working on a touch device. Try setting the useWheel option to false and see if that fixes the problem. Or, just make sure the mousewheel plugin isn't being loaded.

@Timmmy
Copy link
Author

Timmmy commented Aug 17, 2015

Hi Mottie!

You're genious!
Setting useWheel to false indeed fixes the problem.

However I also don't see why this interfers on Android devices.

Thanks!!

@Mottie
Copy link
Owner

Mottie commented Aug 17, 2015

I'm glad that fixed the issue!

I don't know why the mousewheel would interfere either... I'll take a look at the mousewheel plugin when I get some time.

@Mottie
Copy link
Owner

Mottie commented Dec 3, 2015

I believe I found and fixed the issue causing the previous key to be entered. So no more need to be extra vigilant and ensure the mousewheel plugin isn't being loaded.

@Timmmy
Copy link
Author

Timmmy commented Dec 6, 2015

Thanks a lot for the fix!
I'll give it a go :)

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

No branches or pull requests

2 participants