Skip to content

Commit

Permalink
Set the touch flag in FloatingActionButton also in handleTouchEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
jkettmann committed Aug 26, 2016
1 parent 3cffbef commit 2c1ca27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FloatingActionButton/FloatingActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ class FloatingActionButton extends Component {
};

handleTouchEnd = (event) => {
this.setState({zDepth: this.props.zDepth});
this.setState({
touch: true,
zDepth: this.props.zDepth,
});
if (this.props.onTouchEnd) {
this.props.onTouchEnd(event);
}
Expand Down

1 comment on commit 2c1ca27

@ethan-deng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I noticed the issue that on touch device the handleTouchStart doesn't get called at all which cause the touch trigger the hover effect. This fix which set touch to true in the handleTouchEnd fix the issue. There is another related issue that on touch device "touch" will trigger handleTouchTab twice and the 2nd call comes in about 1 or 2 seconds later.

Please sign in to comment.