| 238 | |
| 239 | let interaction = useRef<{pointerType: string; key?: string} | null>(null); |
| 240 | let onPressUp = (e: PressEvent) => { |
| 241 | if (e.pointerType !== 'keyboard') { |
| 242 | interaction.current = {pointerType: e.pointerType}; |
| 243 | } |
| 244 | |
| 245 | // If interacting with mouse, allow the user to mouse down on the trigger button, |
| 246 | // drag, and release over an item (matching native behavior). |
| 247 | if (e.pointerType === 'mouse') { |
| 248 | if (!isPressedRef.current) { |
| 249 | (e.target as HTMLElement).click(); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | pressUpProp?.(e); |
| 254 | }; |
| 255 | |
| 256 | let onClick = (e: MouseEvent<FocusableElement>) => { |
| 257 | onClickProp?.(e); |