react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

React native navigation topbar rightButton is not clickable on ios10

Open archana-iron opened this issue 7 years ago • 1 comments

Issue Description::

Inside Topbar I am using two icons, leftButton is to open the sidebar and rightButton to show and open the system notification.

I am not able to display the rightButton icon on ios version 10.0, it's working fine for ios 11 and 12. To display this button I have added a custom CSS. After this, it displays properly but now I am not able to click on a button, there is no event occurs.

Environment

React Native Navigation version: 2.12.0 React Native version: 0.58 Platform(s) : IOS only(on version 10.0)

Code::

static options({ menuIcon }) {
        return {
            topBar: {
                title: {
                    fontFamily: font,
                    fontSize: fontSize.heading,
                    color: colors.white,
                    alignment: 'center',
                    text: strings.dashboard
                },
                alignment: 'center',
                elevation: 0,
                noBorder: true,
                background: {
                    color: colors.dark
                },
                leftButtons: [
                    {
                        id: 'openSideMenu',
                        icon: menuIcon ? menuIcon : APIURLServiceSingleton.getInstance()._menuIcon
                    }
                ],
                rightButtons: [
                    {
                        id: 'notificationButton',
                        component: {
                            name: 'component.notificationButton'
                        }
                    }
                ]
            }
        }
    }

Custom component section, we are applying this to rightButton. Code of this section as follows::


<TouchableOpacity
    onPress={() => this.openSystemAlerts()}
    style={{ position: 'absolute', right: 0, bottom: -13 }}
>
    <View style={styles.button}>
        <View style={[posRelative]}>
            <Icon
                name="notifications-none"
                size={27}
                color={colors.white}
            />
            {(unseen_count && unseen_count > 0) &&
                <Text style={styles.badge}>{unseen_count}</Text>
            }
        </View>
    </View>
</TouchableOpacity>

Please suggest me how I can add an event on rightButton using this package, for ios version 10.0 or below.

archana-iron avatar Feb 28 '19 04:02 archana-iron

Hey @archana-iron

This has recently been fixed: https://github.com/wix/react-native-navigation/commit/8282d934f70d512548d6d4ceae25e9798d591141

Also duplicate of: https://github.com/wix/react-native-navigation/issues/4759

ItsNoHax avatar Feb 28 '19 09:02 ItsNoHax