Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Support repeatedly selecting suggestions in FF and IE #7

@torsjonas

Description

@torsjonas

It appears that selecting a suggestion only works as expected in Chrome. After the first time in FF and IE, when selecting a second suggestion the index of the selected suggestion is not correct/undefined and the inputValue is set to undefined.

This can be repeated on the demo page of paper-typeahead-input:
http://cheonhyangzhang.github.io/paper-typeahead-input/components/paper-typeahead-input/

On the demo page for entering US states, in FF or IE

  1. Select Oregon. Oregon is set as the inputValue.
  2. Select Washington. undefined is set as the inputValue.

I have managed to avoid this problem in IE and FF with the following code in the _select function:

// These two lines only work in Chrome (and only the first time in IE and FF)
// index = Number(suggestionsMenu.indexOf(selectedItem));
// this.inputValue = this._suggestions[index];

// The following lines work in Chrome, FF and IE
index = this._suggestions.indexOf(e.model.item);
this.inputValue = this._suggestions[index];

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions