(
shouldOpen: boolean,
e: KeyboardEvent,
focusStrategy: FocusStrategy = 'first'
)
| 61 | let {triggerProps, overlayProps} = useOverlayTrigger({type}, state, ref); |
| 62 | |
| 63 | let open = ( |
| 64 | shouldOpen: boolean, |
| 65 | e: KeyboardEvent, |
| 66 | focusStrategy: FocusStrategy = 'first' |
| 67 | ): boolean | void => { |
| 68 | if (!shouldOpen || e.isDefaultPrevented()) { |
| 69 | return false; |
| 70 | } |
| 71 | state.toggle(focusStrategy); |
| 72 | }; |
| 73 | |
| 74 | // React puts listeners on the same root, so even if propagation was stopped, immediate propagation is still possible. |
| 75 | // useTypeSelect will handle the spacebar first if it's running, so we don't want to open if it's handled it already. |
no test coverage detected