mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-24 19:28:15 +03:00
25 lines
609 B
JavaScript
25 lines
609 B
JavaScript
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?.();
|
|
}
|
|
},
|
|
}}
|
|
/>
|
|
);
|
|
}
|