This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
md-autocomplete Can't select item when searchText equals the one and only item in md-items #1858
Closed
Description
If you have a list of items ['foo', 'bar']
and you type 'fo'
'foo' is listed under the input. This is fine.
If you enter 'foo' then the list disappears which is fine too.
BUT from there pressing ENTER does not select the item and initiate md-selected-item-change.
However, if you type 'foo' then press DOWN ARROW then ENTER it will select it properly because the highlighted item index was changed to 0 by pressing DOWN ARROW.
I think it should automatically select the first item in the list when you press ENTER if no item is highlighted (index == -1) and the list has at least one item in it.
maybe do something like this?
If item list is > 0 and index == -1
select(0)
Metadata
Metadata
Assignees
Labels
No labels