bradley
bradley

Reputation: 455

Switched to Angular4, material 2 autoComplete onSelect() not working

Just switched to Angular 4 and material 2 autoComplete's onSelect() on md-option is no longer working but I can't find any documentation on this. Whats the fix?

<md-autocomplete #auto="mdAutocomplete" [displayWith]="displayText.bind(this)">
<md-option (onSelect)="selectItem(item)" *ngFor="let item of filteredItems | async" [value]="item">
  {{ item[propertyName] }}
</md-option>
</md-autocomplete>

Upvotes: 2

Views: 887

Answers (2)

Zoe
Zoe

Reputation: 1

You can use the keyUp event:

(keyup)="selectItem(item)" 

Upvotes: 0

bradley
bradley

Reputation: 455

For anyone else looking for the answer it was changed to onSelectionChange.

Upvotes: 2

Related Questions