Skip to content
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.

Programmatically setting md-search-text in md-autocomplete opens dropdown #2767

@PritishC

Description

@PritishC

Hi there!

I came across this quirk in md-autocomplete, with the following steps -:

  1. I bind md-search-text programmatically, say 'Steve'.
  2. I bind 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).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions