adopted-ember-addons / adopted-ember-addons/ember-paper
Allow the autocomplete in paper-chips to open on input focus
- Vorherrschende Sprache
- JavaScript
- Sterne
- 879
- Forks
- 327
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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?
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.