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

Not working in mobile Android browser #36

Open
karsunke opened this issue Apr 20, 2016 · 8 comments
Open

Not working in mobile Android browser #36

karsunke opened this issue Apr 20, 2016 · 8 comments

Comments

@karsunke
Copy link

karsunke commented Apr 20, 2016

I tried horsey on several devices. It works in every Desktop browser I tested. Also on iOS browsers. But there seems to be a problem with the mobile Android browser (Chrome).

Typing in the box does not fire any events. No list is shown. I debugged it and there is no error message. You can test it at the sample page http://bevacqua.github.io/horsey/

@karsunke
Copy link
Author

karsunke commented Apr 21, 2016

I managed to find a workaround. Just add a keydown event listener and call the methods hide and show. With jQuery it looks like this:

var jElement = $("#address-search");
jElement.keydown(function() {
    horseyElement.hide();
    horseyElement.show();
})

@bevacqua
Copy link
Owner

Is this still the case?

@karsunke
Copy link
Author

Yep. Still the same. I tried it again with the latest Android Chrome Browser.

@akrawchyk
Copy link

akrawchyk commented Aug 31, 2016

@karsunke thanks for the workaround!

Although, it does ruin UX/accessibility since the user can no longer navigate the autocomplete list via the keyboard. The workaround hides then shows the list again on arrow press, which resets the selection item.

@akrawchyk
Copy link

akrawchyk commented Aug 31, 2016

@karsunke this does the same except maintains the user's ability to navigate the list via keyboard arrows:

var KEY_UP = 38;
var KEY_DOWN = 40;
var jElement = $("#address-search");
jElement.keyup(function(e) {
  if (!e.keyCode === KEY_UP && !e.keyCode === KEY_DOWN) {
    horseyInstance.hide();
    horseyInstance.show();
  }
});

@karsunke
Copy link
Author

@akrawchyk Thanks for the addition.

@zspitzer
Copy link

zspitzer commented Oct 3, 2016

Alas, Chrome is pretty painful with keydown events and soft keyboards, here is the WONTFIX bug from 2012 with 259 comments! https://bugs.chromium.org/p/chromium/issues/detail?id=118639

Solution might be to use the newer "input" rather than keydown event which is supported by everything since IE9 https://developer.mozilla.org/en/docs/Web/API/GlobalEventHandlers/oninput

@beatfreaker
Copy link

beatfreaker commented Oct 16, 2016

Hi @karsunke i am facing the same issue can you please help me out. I tried your approach but i didn't got what horseyElement should be.

can you please give me an example?

var horseyElement = horsey(document.querySelector('#profile-cities'), {
    source: function(data, done) {;
    }
});
jQuery('#profile-cities').keydown(function() {
    horseyElement.hide();
    horseyElement.show();
});

this is my code, can you please correct the code and tell me where i am going wrong?

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

No branches or pull requests

5 participants