Skip to content

Commit

Permalink
Fixes #307 - onClick of buttons doesn't fire in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Nguyen committed Feb 10, 2015
1 parent e6e43c1 commit 5e1bc35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/ripples/touch-ripple.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ var TouchRipple = React.createClass({
render: function() {
var classes = this.getClasses('mui-touch-ripple');

//This is needed to keep click events from getting lost
//in safari. Without it, onClick won't fire.
var shieldStyle = {
position: 'absolute',
height: '100%',
width: '100%'
};

return (
<div
className={classes}
Expand All @@ -34,6 +42,7 @@ var TouchRipple = React.createClass({
onTouchStart={this._handleTouchStart}
onTouchEnd={this._handleTouchEnd}>
{this._getRippleElements()}
<div style={shieldStyle} />
</div>
);
},
Expand Down

0 comments on commit 5e1bc35

Please sign in to comment.