Sets the role attribute for this trigger if needed.
()
| 366 | |
| 367 | /** Sets the role attribute for this trigger if needed. */ |
| 368 | private _setRole() { |
| 369 | // If this trigger is part of another menu, the cdkMenuItem directive will handle setting the |
| 370 | // role, otherwise this is a standalone trigger, and we should ensure it has role="button". |
| 371 | if (!this._parentMenu) { |
| 372 | this._elementRef.nativeElement.setAttribute('role', 'button'); |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | /** Sets thte `type` attribute of the trigger. */ |
| 377 | private _setType() { |