nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.42k stars 41 forks source link

Auxiliary gets smaller every time #85

Open FranciscoFonseca opened 1 month ago

FranciscoFonseca commented 1 month ago

Trying auxiliary menu, everything is working fine but the auxuliary gets smaller every time. Already tried adding a width bigger than the phone but it seems tha auxiliary itself is getting small.

https://github.com/nandorojo/zeego/assets/13562419/86412f65-91de-4a22-958c-59f997ed6cac

Platform: IOs

nandorojo commented 1 month ago

Yeah the settings are very particular. Are you on the latest iOS menu version? Try setting height and width props on it

FranciscoFonseca commented 1 month ago

Running iOs 17.4.1 <ContextMenu.Auxiliary key={'reaction'} height={50} width={80}> this is how i am running it right now

nandorojo commented 1 month ago

The iOS menu version, not iOS version.

See the upstream iOS context menu docs for example props of the auxiliary menu.

ghoudi01 commented 1 month ago

Here's a solution that should work for you, though it's not the most optimal way to handle this: First, create a state to track whether the menu is open: const [isMenuOpen, setIsMenuOpen] = React.useState(false); pass this handler to the ContextMenu.Root component:

const onOpenChange = (isOpen) => {
  setIsMenuOpen(isOpen);
};
<ContextMenu.Root onOpenWillChange={onOpenChange}>
    {isMenuOpen&&(<ContextMenu.Auxiliary 
      alignmentHorizontal={isOwner?"previewTrailing": 'previewLeading'}
     > 

     {({ dismissMenu }) => (
        <youComponent/>
      )}

      </ContextMenu.Auxiliary> )}
</ContextMenu.Root>