Search code examples
react-native-popup-menu

How to calculate position of context menu?


The context menu is far lower than it should be. I attempted to use

<Menu renderer={Popover} rendererProps={{ placement: 'top' }} >

but this only minimally helped. Here is a screenshot. any help is appreciated.

enter image description here

EDIT: I have now used the custom menu as shown at https://github.com/instea/react-native-popup-menu/blob/master/doc/extensions.md.

This moves the options menu to the correct position but loses all styling and has no animation as well as never disapearing.

const CustomMenu = (props) => {
const { style, children, layouts, ...other } = props;
const position = { top: 0, right: 0 }
return (
    <View name={'newquote2'} {...other} style={[style, position]}>
        {children}
    </View>
);

};


Solution

  • You need to use the libraries menu component with your own custom menu. for example

    <Menu renderer={CustomMenu} >