Handles keyboard events on the header.
(event: KeyboardEvent)
| 334 | |
| 335 | /** Handles keyboard events on the header. */ |
| 336 | _handleKeydown(event: KeyboardEvent) { |
| 337 | // We don't handle any key bindings with a modifier key. |
| 338 | if (hasModifierKey(event)) { |
| 339 | return; |
| 340 | } |
| 341 | |
| 342 | switch (event.keyCode) { |
| 343 | case ENTER: |
| 344 | case SPACE: |
| 345 | if (this.focusIndex !== this.selectedIndex) { |
| 346 | const item = this._items.get(this.focusIndex); |
| 347 | |
| 348 | if (item && !item.disabled) { |
| 349 | this.selectFocusedIndex.emit(this.focusIndex); |
| 350 | this._itemSelected(event); |
| 351 | } |
| 352 | } |
| 353 | break; |
| 354 | default: |
| 355 | this._keyManager?.onKeydown(event); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * Callback for when the MutationObserver detects that the content has changed. |
nothing calls this directly
no test coverage detected