|
1 | | -import { useRef, useLayoutEffect, useEffect, useReducer } from 'react' |
| 1 | +import { useEffect, useLayoutEffect, useReducer, useRef } from 'react' |
2 | 2 |
|
3 | 3 | import { |
4 | 4 | addMonths, |
@@ -200,14 +200,14 @@ export default function useGrid({ locale, month: currentMonth, onMonthChange, tr |
200 | 200 | } |
201 | 201 | } |
202 | 202 |
|
203 | | - containerElement.addEventListener('touchstart', handleDragStart) |
204 | | - containerElement.addEventListener('touchmove', handleDrag) |
205 | | - containerElement.addEventListener('touchend', handleDragEnd) |
| 203 | + containerElement.addEventListener('touchstart', handleDragStart, { passive: true }) |
| 204 | + containerElement.addEventListener('touchmove', handleDrag, { passive: true }) |
| 205 | + containerElement.addEventListener('touchend', handleDragEnd, { passive: true }) |
206 | 206 |
|
207 | 207 | return () => { |
208 | | - containerElement.removeEventListener('touchstart', handleDragStart) |
209 | | - containerElement.removeEventListener('touchmove', handleDrag) |
210 | | - containerElement.removeEventListener('touchend', handleDragEnd) |
| 208 | + containerElement.removeEventListener('touchstart', handleDragStart, { passive: true }) |
| 209 | + containerElement.removeEventListener('touchmove', handleDrag, { passive: true }) |
| 210 | + containerElement.removeEventListener('touchend', handleDragEnd, { passive: true }) |
211 | 211 | } |
212 | 212 | } |
213 | 213 | }) |
|
0 commit comments