Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onClick event fires for both left and right click in firefox #152

Closed
bryceosterhaus opened this issue Aug 18, 2016 · 1 comment
Closed
Assignees
Labels

Comments

@bryceosterhaus
Copy link
Member

bryceosterhaus commented Aug 18, 2016

Create a jsx component like so

class MyComponent extends Component {
    render() {
        return (
            <div onClick={() => console.log("fire")}>MyComponent</div>
        );
    }
}

Render the component and use firefox. Click on the MyComponent text with a "right click". The console log will fire.

This does not happen in Chrome. I am currently running [email protected]

I have not tested this in soy.

@mairatma
Copy link
Contributor

You're right. I took a look and it seems like Firefox has some special behavior for right clicks. Like all other browsers, it doesn't trigger onclick for right clicks on regular elements, but it still triggers it for the document. Since we use delegate logic on the document, we end up triggering it for regular elements too.

I'll see what I can do to go around this Firefox problem so it doesn't affect us.

@mairatma mairatma added the bug label Aug 29, 2016
@mairatma mairatma self-assigned this Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants