(e: MouseEvent<FocusableElement>)
| 254 | }; |
| 255 | |
| 256 | let onClick = (e: MouseEvent<FocusableElement>) => { |
| 257 | onClickProp?.(e); |
| 258 | performAction(); |
| 259 | handleLinkClick(e, router, item!.props.href, item?.props.routerOptions); |
| 260 | |
| 261 | let shouldClose = |
| 262 | interaction.current?.pointerType === 'keyboard' |
| 263 | ? // Always close when pressing Enter key, or if item is not selectable. |
| 264 | interaction.current?.key === 'Enter' || |
| 265 | selectionManager.selectionMode === 'none' || |
| 266 | selectionManager.isLink(key) |
| 267 | : // Close except if multi-select is enabled. |
| 268 | selectionManager.selectionMode !== 'multiple' || selectionManager.isLink(key); |
| 269 | |
| 270 | shouldClose = shouldCloseOnSelect ?? closeOnSelect ?? shouldClose; |
| 271 | |
| 272 | if (onClose && !isTrigger && shouldClose) { |
| 273 | onClose(); |
| 274 | } |
| 275 | |
| 276 | interaction.current = null; |
| 277 | }; |
| 278 | |
| 279 | let {itemProps, isFocused} = useSelectableItem({ |
| 280 | id, |
nothing calls this directly
no test coverage detected