(e: KeyboardEvent, indexOfItem: number)
| 962 | } |
| 963 | |
| 964 | _handleArrowDown(e: KeyboardEvent, indexOfItem: number) { |
| 965 | const isOpen = this.open; |
| 966 | |
| 967 | if (this.focused && indexOfItem === -1 && isOpen) { |
| 968 | this.focused = false; |
| 969 | } |
| 970 | |
| 971 | const allItems = this._getItems(); |
| 972 | const currentItem = allItems[indexOfItem]; |
| 973 | const isLastItem = indexOfItem === allItems.length - 1; |
| 974 | |
| 975 | // We don't want to navigate further if the current item is the last one and either is already focused or the popover is closed |
| 976 | if (isLastItem && ((isOpen && currentItem.focused) || !isOpen)) { |
| 977 | return; |
| 978 | } |
| 979 | |
| 980 | const itemIndexToBeFocused = isLastItem ? indexOfItem : indexOfItem + 1; |
| 981 | |
| 982 | this._handleItemNavigation(e, itemIndexToBeFocused, true /* isForward */); |
| 983 | } |
| 984 | |
| 985 | _handleArrowUp(e: KeyboardEvent, indexOfItem: number) { |
| 986 | const isOpen = this.open; |
nothing calls this directly
no test coverage detected