Don't trigger table row click events in admin UI on text selection.

This commit is contained in:
Sebastian Jeltsch
2025-02-04 22:34:41 +01:00
parent 75d9b79b9c
commit ea5f85a192
2 changed files with 8 additions and 2 deletions

View File

@@ -441,8 +441,8 @@ export function formFieldBuilder(
return buildNumberFormField({ label });
}
console.warn(
`Type: (${type}, ${optional}) not (yet) supported. Falling back to textfields`,
console.debug(
`Custom FormFields not yet implemented for (${type}, ${optional}). Falling back to textfields`,
);
if (optional) {
return buildOptionalTextFormField({ label, nullPlaceholder });

View File

@@ -238,6 +238,12 @@ export function DataTable<TData, TValue>(props: Props<TData, TValue>) {
<For each={table().getRowModel().rows}>
{(row) => {
const onClick = () => {
// Don't trigger on text selection.
const selection = window.getSelection();
if (selection?.toString()) {
return;
}
const handler = props.onRowClick;
if (!handler) {
return;