Handles key presses on the trigger.
(event: KeyboardEvent)
| 176 | |
| 177 | /** Handles key presses on the trigger. */ |
| 178 | _handleKeydown(event: KeyboardEvent): void { |
| 179 | const keyCode = event.keyCode; |
| 180 | |
| 181 | // Pressing enter on the trigger will trigger the click handler later. |
| 182 | if (keyCode === ENTER || keyCode === SPACE) { |
| 183 | this._openedBy = 'keyboard'; |
| 184 | } |
| 185 | |
| 186 | if ( |
| 187 | this.triggersSubmenu() && |
| 188 | ((keyCode === RIGHT_ARROW && this.dir === 'ltr') || |
| 189 | (keyCode === LEFT_ARROW && this.dir === 'rtl')) |
| 190 | ) { |
| 191 | this._openedBy = 'keyboard'; |
| 192 | this.openMenu(); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | /** Handles click events on the trigger. */ |
| 197 | _handleClick(event: MouseEvent): void { |
nothing calls this directly
no test coverage detected