Files
supabase/patches/react-data-grid.patch
Gildas Garcia 77004016f4 fix: cannot resize table editor columns on safari (#43450)
## Problem

On Safari, it's impossible to resize a column.

## Solution 

This is actually a bug in `react-data-grid` that has been fixed in more
recent versions but we can't use them.
Patch the package

## How to test

- Open the any table in the _Table editor_
- Resize a column
2026-03-06 08:01:22 +01:00

33 lines
1.4 KiB
Diff

diff --git a/lib/bundle.cjs b/lib/bundle.cjs
index 810cb878ffb394df9f17296995a838e08a7d6ccf..4ba752efe1b1de392c3254d1b0d12ab9a637362f 100644
--- a/lib/bundle.cjs
+++ b/lib/bundle.cjs
@@ -1412,10 +1412,7 @@ function HeaderCell({
hasDoubleClicked = true;
onColumnResize(column, 'max-content');
}
- function onLostPointerCapture(event) {
- if (!hasDoubleClicked) {
- onPointerMove(event);
- }
+ function onLostPointerCapture() {
currentTarget.removeEventListener('pointermove', onPointerMove);
currentTarget.removeEventListener('dblclick', onDoubleClick);
currentTarget.removeEventListener('lostpointercapture', onLostPointerCapture);
diff --git a/lib/bundle.js b/lib/bundle.js
index ac667d97a43720d1f56995e63ad6556b80d4c4bf..42b6a17f382fffadbb8cdd2d7a6b42235af89ad0 100644
--- a/lib/bundle.js
+++ b/lib/bundle.js
@@ -1408,10 +1408,7 @@ function HeaderCell({
hasDoubleClicked = true;
onColumnResize(column, 'max-content');
}
- function onLostPointerCapture(event) {
- if (!hasDoubleClicked) {
- onPointerMove(event);
- }
+ function onLostPointerCapture() {
currentTarget.removeEventListener('pointermove', onPointerMove);
currentTarget.removeEventListener('dblclick', onDoubleClick);
currentTarget.removeEventListener('lostpointercapture', onLostPointerCapture);