adopted-ember-addons / adopted-ember-addons/ember-paper

Allow the autocomplete in paper-chips to open on input focus

Ouverte
#612 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
879
Forks
327
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

There are cases when having the autocomplete to open automatically when the input receives focus is desirable. For example, when you have a small list of options that the user can choose or when the user doesn't know what options are available (so he doesn't know what to search).

In [paper-chips.js](https://github.com/miguelcobain/ember-paper/blob/7ba0c103ebd093792c60241000eae1f0df4fe29c/addon/components/paper-chips.js), there are 3 pieces of code that block the autocomplete to open when there is no search.

Lines 75-78:
```javascript
// We don't want the autocomplete to open on focus - it'll open when the user starts typing.
if (isPresent(autocomplete)) {
autocomplete.actions.close();
}
```

Lines 127-132:
```javascript
searchTextChange(searchText, select) {
// Close dropdown if search text is cleared by the user.
if (isEmpty(searchText)) {
select.actions.close();
}
}
```

Lines 202-204:
```javascript
// Close the dropdown after focusing the field.
input.focus();
select.actions.close();
```

Maybe there could be an option to allow the autocomplete to open even when the search is empty?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.