Gets the label to be used when determining whether the option should be focused.
()
| 162 | |
| 163 | /** Gets the label to be used when determining whether the option should be focused. */ |
| 164 | getLabel(): string { |
| 165 | const clone = this._elementRef.nativeElement.cloneNode(true) as HTMLElement; |
| 166 | const icons = clone.querySelectorAll( |
| 167 | 'mat-icon, .material-icons, .material-symbols-outlined, ' + |
| 168 | '.material-symbols-rounded, .material-symbols-sharp', |
| 169 | ); |
| 170 | |
| 171 | // Strip away icons, so they don't show up in the text. |
| 172 | for (let i = 0; i < icons.length; i++) { |
| 173 | icons[i].remove(); |
| 174 | } |
| 175 | |
| 176 | return clone.textContent?.trim() || ''; |
| 177 | } |
| 178 | |
| 179 | _setHighlighted(isHighlighted: boolean) { |
| 180 | // We need to mark this for check for the case where the content is coming from a |