* Set focus the either the current, previous or next item based on the FocusNext event. * @param focusNext The element to focus.
(focusNext: FocusNext | undefined)
| 107 | * @param focusNext The element to focus. |
| 108 | */ |
| 109 | private _toggleMenuFocus(focusNext: FocusNext | undefined) { |
| 110 | const keyManager = this.keyManager; |
| 111 | switch (focusNext) { |
| 112 | case FocusNext.nextItem: |
| 113 | keyManager.setFocusOrigin('keyboard'); |
| 114 | keyManager.setNextItemActive(); |
| 115 | break; |
| 116 | |
| 117 | case FocusNext.previousItem: |
| 118 | keyManager.setFocusOrigin('keyboard'); |
| 119 | keyManager.setPreviousItemActive(); |
| 120 | break; |
| 121 | |
| 122 | case FocusNext.currentItem: |
| 123 | if (keyManager.activeItem) { |
| 124 | keyManager.setFocusOrigin('keyboard'); |
| 125 | keyManager.setActiveItem(keyManager.activeItem); |
| 126 | } |
| 127 | break; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /** Subscribe to the MenuStack emptied events. */ |
| 132 | private _subscribeToMenuStackEmptied() { |
no test coverage detected