diff --git a/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx b/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx index e4d3c51d905e6..5d77f559a16a4 100644 --- a/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx +++ b/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx @@ -57,28 +57,6 @@ type AutosizeOptionsRequired = Required; type ResizeDirection = keyof typeof GridColumnHeaderSeparatorSides; -// TODO: remove support for Safari < 13. -// https://caniuse.com/#search=touch-action -// -// Safari, on iOS, supports touch action since v13. -// Over 80% of the iOS phones are compatible -// in August 2020. -// Utilizing the CSS.supports method to check if touch-action is supported. -// Since CSS.supports is supported on all but Edge@12 and IE and touch-action -// is supported on both Edge@12 and IE if CSS.supports is not available that means that -// touch-action will be supported -let cachedSupportsTouchActionNone = false; -function doesSupportTouchActionNone(): boolean { - if (cachedSupportsTouchActionNone === undefined) { - if (typeof CSS !== 'undefined' && typeof CSS.supports === 'function') { - cachedSupportsTouchActionNone = CSS.supports('touch-action', 'none'); - } else { - cachedSupportsTouchActionNone = true; - } - } - return cachedSupportsTouchActionNone; -} - function trackFinger(event: any, currentTouchId: number | undefined): CursorCoordinates | boolean { if (currentTouchId !== undefined && event.changedTouches) { for (let i = 0; i < event.changedTouches.length; i += 1) { @@ -593,10 +571,6 @@ export const useGridColumnResize = ( if (!cellSeparator) { return; } - // If touch-action: none; is not supported we need to prevent the scroll manually. - if (!doesSupportTouchActionNone()) { - event.preventDefault(); - } const touch = event.changedTouches[0]; if (touch != null) { @@ -812,7 +786,7 @@ export const useGridColumnResize = ( () => apiRef.current.columnHeadersContainerRef?.current, 'touchstart', handleTouchStart, - { passive: doesSupportTouchActionNone() }, + { passive: true }, ); useGridApiMethod(