(e)
| 123 | let pressProps: PressProps = { |
| 124 | preventFocusOnPress: true, |
| 125 | onPressStart(e) { |
| 126 | // For consistency with native, open the menu on mouse/key down, but touch up. |
| 127 | if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) { |
| 128 | // Ensure trigger has focus before opening the menu so it can be restored by FocusScope on close. |
| 129 | focusWithoutScrolling(e.target as FocusableElement); |
| 130 | |
| 131 | // If opened with a screen reader, auto focus the first item. |
| 132 | // Otherwise, the menu itself will be focused. |
| 133 | state.open(e.pointerType === 'virtual' ? 'first' : null); |
| 134 | } |
| 135 | }, |
| 136 | onPress(e) { |
| 137 | if (e.pointerType === 'touch' && !isDisabled) { |
| 138 | // Ensure trigger has focus before opening the menu so it can be restored by FocusScope on close. |
nothing calls this directly
no test coverage detected