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 59356e0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const Row = memo(function Row({

let handleRowClick;

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

Expand All @@ -137,6 +137,8 @@ export const Row = memo(function Row({
event.preventDefault();

if (onClick) {
event.stopPropagation();
event.preventDefault();
onClick();
return;
}
Expand Down

0 comments on commit 59356e0

Please sign in to comment.