* Focuses the first selected chip in this chip listbox, or the first non-disabled chip when there * are no selected chips.
()
| 228 | * are no selected chips. |
| 229 | */ |
| 230 | override focus(): void { |
| 231 | if (this.disabled) { |
| 232 | return; |
| 233 | } |
| 234 | |
| 235 | const firstSelectedChip = this._getFirstSelectedChip(); |
| 236 | |
| 237 | if (firstSelectedChip && !firstSelectedChip.disabled) { |
| 238 | firstSelectedChip.focus(); |
| 239 | } else if (this._chips.length > 0) { |
| 240 | this._keyManager.setFirstItemActive(); |
| 241 | } else { |
| 242 | this._elementRef.nativeElement.focus(); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Implemented as part of ControlValueAccessor. |
nothing calls this directly
no test coverage detected