-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Programmatically setting md-search-text
in md-autocomplete opens dropdown
#2767
Comments
I believe this is similar to an issue I opened yesterday (#2756), which I encountered more specifically when modifying the The behavior is being caused by the The problem, I think, is that currently |
+1, I agree that the Setting the value programmatically would not bring focus on the control, thus keeping the dropdown hidden. |
This is a duplicate of #2756 |
Hi there!
I came across this quirk in
md-autocomplete
, with the following steps -:md-search-text
programmatically, say 'Steve'.md-selected-item
programmatically to a hash, say{name: 'Steve', id: 2}
(not necessary for quirk reproduction - I need it for my own purposes).Now the clincher is that there are multiple results corresponding to 'Steve' (different people with the same first name?), and this causes the dropdown list to open up. I don't need the dropdown list to open up at this point - I've already made the right selection. Is there a way to prevent the opening of the dropdown if I'm making the selection programmatically?
On the other hand, if there aren't multiple results,
md-autocomplete
still tries to fire a search. This, again, isn't really needed as I've already made the right selection.Example CodePen which demonstrates the issue (line 15 in JS).
The text was updated successfully, but these errors were encountered: