mirror of
https://github.com/trailbaseio/trailbase.git
synced 2026-02-21 01:39:29 -06:00
Don't trigger table row click events in admin UI on text selection.
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user