Fixes Ripple event error in case props.ripple === false (#1344)

old
k0r8i 2017-04-02 14:05:06 +02:00 committed by Javi Velasco
parent ec5f15dc12
commit ad6f30336f
1 changed files with 4 additions and 2 deletions

View File

@ -222,9 +222,11 @@ const rippleFactory = (options = {}) => {
};
}
doRipple = () => (!this.props.disabled && this.props.ripple)
handleMouseDown = (event) => {
if (this.props.onMouseDown) this.props.onMouseDown(event);
if (!this.props.disabled) {
if (this.doRipple()) {
const { x, y } = events.getMousePosition(event);
this.animateRipple(x, y, false);
}
@ -232,7 +234,7 @@ const rippleFactory = (options = {}) => {
handleTouchStart = (event) => {
if (this.props.onTouchStart) this.props.onTouchStart(event);
if (!this.props.disabled) {
if (this.doRipple()) {
const { x, y } = events.getTouchPosition(event);
this.animateRipple(x, y, true);
}