Skip to content

Commit

Permalink
Allow row click when onClick is passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
sydturn committed Mar 19, 2024
1 parent 908897f commit e7a0fac
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ export const Row = memo(function Row({
disabled && styles['TableRow-disabled'],
tone && styles[variationName('tone', tone)],
!selectable &&
!onClick &&
!primaryLinkElement.current &&
styles['TableRow-unclickable'],
);

let handleRowClick;

if ((!disabled && selectable) || primaryLinkElement.current) {
if ((!disabled && selectable) || onClick || primaryLinkElement.current) {
handleRowClick = (event: React.MouseEvent) => {
if (rowType === 'subheader') return;

Expand All @@ -141,7 +142,7 @@ export const Row = memo(function Row({
return;
}

if (primaryLinkElement.current && !selectMode) {
if (primaryLinkElement.current && !selectMode && selectable) {
isNavigating.current = true;
const {ctrlKey, metaKey} = event.nativeEvent;

Expand Down

0 comments on commit e7a0fac

Please sign in to comment.