Skip to content

Commit 1b6623f

Browse files
oliviertassinariDungTiger
authored andcommitted
[data grid] Remove dead logic to support Safari < 13 (mui#13249)
1 parent f1da7ee commit 1b6623f

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx

+1-27
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,6 @@ type AutosizeOptionsRequired = Required<GridAutosizeOptions>;
5757

5858
type ResizeDirection = keyof typeof GridColumnHeaderSeparatorSides;
5959

60-
// TODO: remove support for Safari < 13.
61-
// https://caniuse.com/#search=touch-action
62-
//
63-
// Safari, on iOS, supports touch action since v13.
64-
// Over 80% of the iOS phones are compatible
65-
// in August 2020.
66-
// Utilizing the CSS.supports method to check if touch-action is supported.
67-
// Since CSS.supports is supported on all but Edge@12 and IE and touch-action
68-
// is supported on both Edge@12 and IE if CSS.supports is not available that means that
69-
// touch-action will be supported
70-
let cachedSupportsTouchActionNone = false;
71-
function doesSupportTouchActionNone(): boolean {
72-
if (cachedSupportsTouchActionNone === undefined) {
73-
if (typeof CSS !== 'undefined' && typeof CSS.supports === 'function') {
74-
cachedSupportsTouchActionNone = CSS.supports('touch-action', 'none');
75-
} else {
76-
cachedSupportsTouchActionNone = true;
77-
}
78-
}
79-
return cachedSupportsTouchActionNone;
80-
}
81-
8260
function trackFinger(event: any, currentTouchId: number | undefined): CursorCoordinates | boolean {
8361
if (currentTouchId !== undefined && event.changedTouches) {
8462
for (let i = 0; i < event.changedTouches.length; i += 1) {
@@ -593,10 +571,6 @@ export const useGridColumnResize = (
593571
if (!cellSeparator) {
594572
return;
595573
}
596-
// If touch-action: none; is not supported we need to prevent the scroll manually.
597-
if (!doesSupportTouchActionNone()) {
598-
event.preventDefault();
599-
}
600574

601575
const touch = event.changedTouches[0];
602576
if (touch != null) {
@@ -812,7 +786,7 @@ export const useGridColumnResize = (
812786
() => apiRef.current.columnHeadersContainerRef?.current,
813787
'touchstart',
814788
handleTouchStart,
815-
{ passive: doesSupportTouchActionNone() },
789+
{ passive: true },
816790
);
817791

818792
useGridApiMethod(

0 commit comments

Comments
 (0)