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-...

CommentFileSizeAuthor
#4 2469989-4.patch497 bytesmichel.g
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anybody’s picture

Issue summary: View changes
cockers’s picture

The auto complete fields don't work on my Android phone, a solution to that would be great.

jim_at_miramontes’s picture

There'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...]

michel.g’s picture

Got a working patch ready.

michel.g’s picture

Status: Active » Needs review