* Finds and selects the chip based on its value. * @returns Chip that has the corresponding value.
(value: any, isUserInput: boolean)
| 346 | * @returns Chip that has the corresponding value. |
| 347 | */ |
| 348 | private _selectValue(value: any, isUserInput: boolean): MatChip | undefined { |
| 349 | const correspondingChip = this._chips.find(chip => { |
| 350 | return chip.value != null && this.compareWith(chip.value, value); |
| 351 | }); |
| 352 | |
| 353 | if (correspondingChip) { |
| 354 | isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select(); |
| 355 | } |
| 356 | |
| 357 | return correspondingChip; |
| 358 | } |
| 359 | |
| 360 | /** Syncs the chip-listbox selection state with the individual chips. */ |
| 361 | private _syncListboxProperties() { |
no test coverage detected