Fixes Ripple event error in case props.ripple === false (#1344)
parent
ec5f15dc12
commit
ad6f30336f
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue