* Handles Alt + Up/Down. * Switches focus between column header, last focused item, and "More" button (if applicable). * @private
(e: KeyboardEvent)
| 700 | * @private |
| 701 | */ |
| 702 | _handleArrowAlt(e: KeyboardEvent) { |
| 703 | const shouldMoveUp: boolean = isUpAlt(e); |
| 704 | const target = e.target as ITableRow; |
| 705 | const focusedElementType = this.getFocusedElementType(target); |
| 706 | |
| 707 | if (shouldMoveUp) { |
| 708 | switch (focusedElementType) { |
| 709 | case TableFocusTargetElement.Row: |
| 710 | case TableFocusTargetElement.GroupRow: |
| 711 | this._prevFocusedRow = target; |
| 712 | return this._onColumnHeaderClick(e); |
| 713 | case TableFocusTargetElement.ColumnHeader: |
| 714 | return this.morеBtn ? this.morеBtn.focus() : this._prevFocusedRow?.focus(); |
| 715 | case TableFocusTargetElement.MoreButton: |
| 716 | return this._prevFocusedRow ? this._prevFocusedRow.focus() : this._onColumnHeaderClick(e); |
| 717 | } |
| 718 | } else { |
| 719 | switch (focusedElementType) { |
| 720 | case TableFocusTargetElement.Row: |
| 721 | case TableFocusTargetElement.GroupRow: |
| 722 | this._prevFocusedRow = target; |
| 723 | return this.morеBtn ? this.morеBtn.focus() : this._onColumnHeaderClick(e); |
| 724 | case TableFocusTargetElement.ColumnHeader: |
| 725 | if (this._prevFocusedRow) { |
| 726 | this._prevFocusedRow.focus(); |
| 727 | } else if (this.morеBtn) { |
| 728 | this.morеBtn.focus(); |
| 729 | } |
| 730 | |
| 731 | return; |
| 732 | case TableFocusTargetElement.MoreButton: |
| 733 | return this._onColumnHeaderClick(e); |
| 734 | } |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | /** |
| 739 | * Determines the type of the currently focused element. |
no test coverage detected