this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Blind fix for submenus bug

+16
+16
src/components/menu-confirm.jsx
··· 1 1 import { Menu, MenuItem, SubMenu } from '@szhsin/react-menu'; 2 2 import { cloneElement } from 'preact'; 3 + import { useRef } from 'preact/hooks'; 3 4 4 5 function MenuConfirm({ 5 6 subMenu = false, ··· 20 21 return children; 21 22 } 22 23 const Parent = subMenu ? SubMenu : Menu; 24 + const menuRef = useRef(); 23 25 return ( 24 26 <Parent 27 + instanceRef={menuRef} 25 28 openTrigger="clickOnly" 26 29 direction="bottom" 27 30 overflow="auto" ··· 31 34 {...restProps} 32 35 menuButton={subMenu ? undefined : children} 33 36 label={subMenu ? children : undefined} 37 + // Test fix for bug; submenus not opening on Android 38 + itemProps={{ 39 + onPointerMove: (e) => { 40 + if (e.pointerType === 'touch') { 41 + menuRef.current?.openMenu?.(); 42 + } 43 + }, 44 + onPointerLeave: (e) => { 45 + if (e.pointerType === 'touch') { 46 + menuRef.current?.openMenu?.(); 47 + } 48 + }, 49 + }} 34 50 > 35 51 <MenuItem className={menuItemClassName} onClick={onClick}> 36 52 {confirmLabel}