Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem:
Some mobile browsers (in my case Firefox mobile) do not trigger "keyUp" events and so the autocomplete does never show up.
Context:
Form input on a mobile device into a Core autocomplete field (Drupal.jsAC)
Related code:
Drupal.jsAC = function ($input, db) {
var ac = this;
this.input = $input[0];
this.ariaLive = $('#' + this.input.id + '-autocomplete-aria-live');
this.db = db;
$input
.keydown(function (event) { return ac.onkeydown(this, event); })
.keyup(function (event) { ac.onkeyup(this, event); })
.blur(function () { ac.hidePopup(); ac.db.cancel(); });
};
Proposed solution:
Add a further event listener on "input" event to trigger ac.onkeyup().
How to reproduce?
Type into a Drupal Core Autocomplete field in Firefox Mobile on Android.
Workaround:
$(document).on('input', '.form-autocomplete', function(event) {
$(this).trigger('keyup');
});
Can someone please confirm the issue?
Let's discuss a clean solution for this.
Related StackOverflow question: http://stackoverflow.com/questions/14194247/key-event-doesnt-trigger-in-...
Comment | File | Size | Author |
---|---|---|---|
#4 | 2469989-4.patch | 497 bytes | michel.g |
Comments
Comment #1
AnybodyComment #2
cockers CreditAttribution: cockers commentedThe auto complete fields don't work on my Android phone, a solution to that would be great.
Comment #3
jim_at_miramontes CreditAttribution: jim_at_miramontes as a volunteer commentedThere's a discussion of this as it relates to a problem I was having with iPads over at https://www.drupal.org/node/2594247 . [I have something of a working hack, but am hesitant to say how release-ready it is...]
Comment #4
michel.g CreditAttribution: michel.g at Randstad Digital for Government of Flanders commentedGot a working patch ready.
Comment #5
michel.g CreditAttribution: michel.g at Randstad Digital for Government of Flanders commented