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 8228da255437181cbe84a9648f5499a50c63bb9f
1 file changed +1
admin/src/DataTable.ts
+1
@@ -133,6 +133,7 @@ export function DataTable({ columns, initialState={}, actions, actionsProps, ini
133 },
134 onCellClick({ field, row }) {
135 if (field === ACTIONS) return
136 + if (window.getSelection()?.type === 'Range') return // not a click but a drag
137 const n = apiRef.current.getVisibleColumns().length
138 const showCols = manipulatedColumns.filter(x =>
139 x.renderCell || x.field === ACTIONS || row[x.field] !== undefined)