Skip to content

Commit

Permalink
fix(slice-machine-ui): TableRow's onClick was called unexpectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
bapmrl committed Oct 24, 2023
1 parent 29967a3 commit bc0af3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/slice-machine/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export const TableRow: FC<TableRowProps> = ({ children, onClick }) => {
[styles.bodyRow]: section === "body",
})}
onClick={(event) => {
if (!onClick) return;
const target = event.target as HTMLElement;
if (!onClick || !event.currentTarget.contains(target)) return;
const focusableAncestor = findFocusableAncestor(target);
if (focusableAncestor?.contains(event.currentTarget) ?? true) {
onClick(event);
Expand Down

0 comments on commit bc0af3a

Please sign in to comment.