Our list of document numbers is completely unique, with no duplicates included.
I am attempting to implement a feature in Angular Material that automatically selects the unique entry when it is copied and pasted.
https://i.stack.imgur.com/70thi.png
Currently, our method involves using OptionSelected for mouse selection, OptionActivated for keyboard selection, and OnBlur for triggering selection when clicking out of the textbox.
I'm wondering if there might be a cleaner solution in Angular Material, or if this approach with three lines of code is the most efficient.
<mat-form-field>
<mat-label>Document Number</mat-label>
<input type="text"
matInput
formControlName="documentNumber"
(blur)="documentNumberChangeEvent($event)"
[matAutocomplete]="auto"
>
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete"
(optionActivated) = "documentNumberChangeEvent($event)"
(optionSelected)="documentNumberChangeEvent($event)"
>