prscX / react-native-popover-menu

React Native: Native Popover Menu
Apache License 2.0
483 stars 54 forks source link

onCancel is not working on Androind #23

Closed mickaelwegerich closed 4 years ago

mickaelwegerich commented 6 years ago

I'm on RN 0.57 and on 0.0.19 popover menu version.

                <TouchableOpacity
                    ref={ref => this.ref = ref}
                    style={styles.missionDeleteIcon}
                    onPress={this.showPopover}
                >
                    <IconFa name={'ellipsis-v'} size={20} />
                </TouchableOpacity>
                <RNPopover
                    visible={this.state.isPopoverVisible}
                    reference={this.ref}
                    onDone={this.onRemove}
                    onCancel={() => alert('alert')}
                >
                    <RNPopover.Menu>
                        <RNPopover.Menu label={'Remove'}/>
                    </RNPopover.Menu>
                </RNPopover>

And only on Android the callback onCancel is not trigger when I click outside the popover menu.

jpaas commented 5 years ago

Same problem here. Can press anywhere to cancel and press the back button to cancel, but onCancel is never called. Works on iOS.

RN 0.57 with version 0.0.21

Shanie1331 commented 5 years ago

Same Issue. @prscX any updates.

hossamnasser938 commented 5 years ago

same here

thepday12 commented 5 years ago

same here

thepday12 commented 5 years ago

I think @prscX u need update version of material-popup-menu 2.20 to 3.2.0. material-popup-menu support func setOnDismissListener for MaterialPopupMenu

HZSamir commented 4 years ago

Seems this problem persists a year after. Can we still hope for a fix? Thank you.

prscX commented 4 years ago

Thanks @thepday12 for sharing the API and solution.

I have integrated fix and pushed the release. You can now use latest version for the same.

Thanks </ Pranav >