mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-25 11:48:14 +03:00
26 lines
609 B
React
26 lines
609 B
React
|
import { SubMenu } from '@szhsin/react-menu';
|
||
|
import { useRef } from 'preact/hooks';
|
||
|
|
||
|
export default function SubMenu2(props) {
|
||
|
const menuRef = useRef();
|
||
|
return (
|
||
|
<SubMenu
|
||
|
{...props}
|
||
|
instanceRef={menuRef}
|
||
|
// Test fix for bug; submenus not opening on Android
|
||
|
itemProps={{
|
||
|
onPointerMove: (e) => {
|
||
|
if (e.pointerType === 'touch') {
|
||
|
menuRef.current?.openMenu?.();
|
||
|
}
|
||
|
},
|
||
|
onPointerLeave: (e) => {
|
||
|
if (e.pointerType === 'touch') {
|
||
|
menuRef.current?.openMenu?.();
|
||
|
}
|
||
|
},
|
||
|
}}
|
||
|
/>
|
||
|
);
|
||
|
}
|