fix: admin/plugins: text selection with the mouse was confused with a click, and a dialog is open
Massimo Melina committed
May 18, 2024 at 17:56 UTC
37d0c164e0ade29a504c04247797ebd749c9b04d
1 file changed
+1
admin/src/DataTable.ts
+1
@@ -131,6 +131,7 @@ export function DataTable({ columns, initialState={}, actions, actionsProps, ini
131
},
132
onCellClick({ field, row }) {
133
if (field === ACTIONS) return
134
+ if (window.getSelection()?.type === 'Range') return // not a click but a drag
135
const n = apiRef.current.getVisibleColumns().length
136
const showCols = manipulatedColumns.filter(x =>
137
x.renderCell || x.field === ACTIONS || row[x.field] !== undefined)