@@ -207,17 +207,22 @@ const TouchRipple = React.forwardRef(function TouchRipple(props, ref) {
207207
208208 // Touche devices
209209 if ( event . touches ) {
210- // Prepare the ripple effect.
211- startTimerCommit . current = ( ) => {
212- startCommit ( { pulsate, rippleX, rippleY, rippleSize, cb } ) ;
213- } ;
214- // Delay the execution of the ripple effect.
215- startTimer . current = setTimeout ( ( ) => {
216- if ( startTimerCommit . current ) {
217- startTimerCommit . current ( ) ;
218- startTimerCommit . current = null ;
219- }
220- } , DELAY_RIPPLE ) ; // We have to make a tradeoff with this value.
210+ // check that this isn't another touchstart due to multitouch
211+ // otherwise we will only clear a single timer when unmounting while two
212+ // are running
213+ if ( startTimerCommit . current === null ) {
214+ // Prepare the ripple effect.
215+ startTimerCommit . current = ( ) => {
216+ startCommit ( { pulsate, rippleX, rippleY, rippleSize, cb } ) ;
217+ } ;
218+ // Delay the execution of the ripple effect.
219+ startTimer . current = setTimeout ( ( ) => {
220+ if ( startTimerCommit . current ) {
221+ startTimerCommit . current ( ) ;
222+ startTimerCommit . current = null ;
223+ }
224+ } , DELAY_RIPPLE ) ; // We have to make a tradeoff with this value.
225+ }
221226 } else {
222227 startCommit ( { pulsate, rippleX, rippleY, rippleSize, cb } ) ;
223228 }
0 commit comments