Skip to content

Commit

Permalink
Don't trigger table row click events in admin UI on text selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatz committed Feb 4, 2025
1 parent 75d9b79 commit ea5f85a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trailbase-core/js/admin/src/components/FormFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
6 changes: 6 additions & 0 deletions trailbase-core/js/admin/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ea5f85a

Please sign in to comment.