react-native-popup-menu icon indicating copy to clipboard operation
react-native-popup-menu copied to clipboard

set the anchor of size to 0 and the margin to 0

Open xpbtmusic opened this issue 6 years ago • 2 comments

hi, How can I set the anchor of size to 0 and the margin to 0?

 <Menu
                        renderer={Popover}
                        rendererProps={{anchorStyle: styles.anchorStyle,placement:'top' }}
                    >
                        <MenuTrigger>
                            <View style={{backgroundColor:'green',height:40,width:screen.width,justifyContent:'center'}}>
                            <Text style={{textAlign:'center'}}>select</Text>
                            </View>
                        </MenuTrigger>
                        <MenuOptions customStyles={optionsStyles}>
                            <MenuOption customStyles={optionStylesTop}>
                                    <Text style={{marginLeft:5,color: 'black',textAlign:'center'}}>item</Text>
                            </MenuOption>
                           </MenuOptions>
  </Menu>

xpbtmusic avatar Apr 09 '18 02:04 xpbtmusic

Hi you can set width, height or hide anchor via anchorStyle property, e.g.:

rendererProps={{anchorStyle: {opacity: 0}, placement:'top'}}

Currently it is not possible to get rid of the margin because popover assumes that there is an anchor.

madox2 avatar Apr 09 '18 09:04 madox2

@xpbtmusic you can always use custom renderer - based on popover one. or maybe you can add new property (e.g. anchorSize) to popover renderer and we can merge it to the lib.

sodik82 avatar Apr 16 '18 07:04 sodik82