question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ToolbarAction Hamburger (Left Icon) onPress not working properly in iOs

See original GitHub issue

Current behaviour

ToolbarAction onPress is not fired on iOs when click on left most icon (Hamburger icon) . It works sometimes when click on left bottom of the icon.

Works fine on android though

Same issue for back button in Search bar on iOs

Expected behaviour

onPress should be fired when click on left most icon (Hamburger icon) on iOs

Code sample

 renderToolbar = () => {
        const {
            type,
            isBack,
            enableSearch,
            enableOptions,
            enableNextOption,
            enableSubtitle,
            subtitle,
            goBack,
            onDrawerPress
        } = this.props;
        return (
            <Toolbar>
                {isBack ? (
                    <ToolbarBackAction onPress={goBack} />
                ) : (
                    <ToolbarAction icon="menu" onPress={onDrawerPress} />
                )}

                <ToolbarContent
                    title={type}
                    subtitle={enableSubtitle ? subtitle : null}
                    style={styles.title}
                />

                {enableNextOption && (
                    <ToolbarAction icon="add" onPress={this._onAdd} />
                )}
                {enableSearch && (
                    <ToolbarAction icon="search" onPress={this._onSearch} />
                )}
                {enableOptions && this.renderOptions()}
            </Toolbar>
        );
    };

Screenshots (if applicable)

What have you tried

Tried to use the same code from example app … Same bug

Your Environment

software version
ios or android ios
react-native 0.55.4
react-native-paper 1.8.0
node v8.8.1
npm or yarn 5.4.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
satya164commented, Aug 22, 2018

It’s a react native issue, so it might have been fixed there. If you can still repro it, let me know and I’ll re-open the issue in the React Native repo.

0reactions
victorkvarghesecommented, Aug 23, 2018

I was able to get this working on a new project [rn version: 0.56] Having this issue still with 0.55.4 … I will investigate further and re-open this if needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Icon onPress only working for Android and not iOS
I'm trying to make a custom header component with an icon that can either toggle the navigation drawer or navigate ...
Read more >
How to do Hamburger Menu in React-Native Application
These icons are clickable and will be in bottomed page. We need to create assets folder in root directory. If we not, application...
Read more >
Animated hamburger menu icons for React
Hamburger menu icons for React, with CSS-driven transitions. ... Direction: not applicable ... The animation direction of the icon, left or right.
Read more >
React Native Drawer Navigator Android iOS Tutorial with ...
The drawer opening and closing will be controlled by pressing the Hamburger Icon at the top left side of application screen.
Read more >
Example to Use React Native Vector Icons
Importing Icon Files in iOS; Lastly, Import icon component in your project and start using it. How to use Icon Component? For the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found