Skip to content

Bad interaction between React "click" event handler and native "click" event handler #3790

Closed
@rigdern

Description

@rigdern

In this repro, I created 2 buttons and only one is rendered at a time. One button's click handler is hooked up to React's synthetic "click" event while the other is hooked up to the native "click" event. Even though only one button is rendered at a time, a single click is triggering both click events.

This bug can be hit by apps that mix React components with non-React controls (e.g. jQuery UI).

Repro Steps

I reproed this in Chrome with React 0.13.2.

  1. Go to http://jsfiddle.net/xzucgepn/
  2. Click the button labeled "One"

Expected: There's a button rendered labeled "Two"

Actual: The rendered button still has the label "One"

If you open the console, you'll see "goToTwo" and "goToOne" which indicates that the "One" button's click handler ran and then the "Two" button's click handler ran (even though we never saw button "Two"").

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions