(e: KeyboardEvent)
| 577 | } |
| 578 | |
| 579 | _handleTab(e: KeyboardEvent) { |
| 580 | const isNext = isTabNext(e); |
| 581 | const target = getNormalizedTarget(e.target as HTMLElement); |
| 582 | const targetType: TableFocusTargetElement | undefined = this.getFocusedElementType(e.target as HTMLElement); |
| 583 | |
| 584 | if (this.columnHeaderTabbables.includes(target)) { |
| 585 | if (isNext && this.columnHeaderLastElement === target) { |
| 586 | return this._focusNextElement(); |
| 587 | } |
| 588 | |
| 589 | return; |
| 590 | } |
| 591 | |
| 592 | if (isNext && targetType === TableFocusTargetElement.ColumnHeader && !this.columnHeaderTabbables.length) { |
| 593 | return this._focusNextElement(); |
| 594 | } |
| 595 | |
| 596 | if (targetType === TableFocusTargetElement.Row || !targetType) { |
| 597 | return; |
| 598 | } |
| 599 | |
| 600 | switch (targetType) { |
| 601 | case TableFocusTargetElement.GroupRow: |
| 602 | return isNext ? this._focusNextElement() : this._focusForwardElement(false); |
| 603 | case TableFocusTargetElement.ColumnHeader: |
| 604 | return !isNext && this._focusForwardElement(false); |
| 605 | case TableFocusTargetElement.MoreButton: |
| 606 | if (isNext) { |
| 607 | this._focusForwardElement(true); |
| 608 | } else { |
| 609 | e.preventDefault(); |
| 610 | this.currentElement?.focus(); |
| 611 | } |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | _focusNextElement() { |
| 616 | if (!this.growsWithButton) { |
no test coverage detected