-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Closed
Description
I’m unsure if this is react specific or just how browsers do things, but there is some difference in cross-browser behavior. I tested this with both React 0.10 and 0.11.
The following pattern fires all event handlers in Chrome and Safari, and only the button onClick handler in Firefox.
http://jsbin.com/saxotoqi/1/edit
var Button = React.createClass({
onClick: function(e) {
console.log('onClick');
},
handleDown: function(e) {
console.log('handleDown');
},
handleUp: function(e) {
console.log('handleUp');
},
render: function() {
return (
React.DOM.button({onClick: this.onClick},
'Hello',
React.DOM.canvas({onMouseDown: this.handleDown, onMouseUp: this.handleUp})
)
);
}
});
React.renderComponent(Button(), document.body);
Metadata
Metadata
Assignees
Labels
No labels