Hi, and thanks for this module!

I'm trying to implement this widget in a custom form (as a search bar). I'm using the core taxonomy callback for the options. When I select a term from the list using the enter key, the value briefly appears in the text field and then immediately disappears. Selecting with the mouse works as expected.

Any idea why this could be happening? Here's my code:

$form['search'] = array(
    '#type'   => 'autocomplete_deluxe',
    '#size'   => 60,
    '#autocomplete_deluxe_path' => 'taxonomy/autocomplete/[field_name]',
    '#autocomplete_min_length' => 1,
    '#multiple' => FALSE,
  );

Comments

Fidelix’s picture

I can confirm this bug. It happens with the core term selection too...

I tested on Opera and Chrome, and the bug is there.

Fidelix’s picture

Maybe it's something here?

 // Override enter keypress for the form, but only when the input hasn't
    // the focus and it isn\t empty.
    $('form').keypress(function(event) {
      if (event.keyCode == 13 && instance.hasFocus && instance.jqObject.val() !== "") return false;
    });
Fidelix’s picture

Category: support » bug
Priority: Normal » Major

Bump.

This is a big usability problem. I have asked 3 persons to fill the node form with the autocomplete, and they all tried to select the values on the dropdown using the keyboard, then pressed enter.

sepgil’s picture

Component: Code » Single values - allow new and deny new values

Sorry for that big, dumb bug. I simply had forgotten to add some brackets arround the OR statements in the keypress functions. The problem is now fixed in the dev version.

sepgil’s picture

Component: Single values - allow new and deny new values » Single values - allow new values
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.