Skip to content

Commit 371de93

Browse files
committed
fix: stop event propagation on action button click
1 parent 86951a0 commit 371de93

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ui/src/components/notifications/NotificationActions.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ interface NotificationActionsProps {
1111
export function NotificationActions({ actions }: NotificationActionsProps) {
1212
if (actions.length === 0) return null;
1313

14-
const handleClick = async (action: NotificationAction) => {
14+
const handleClick = async (
15+
e: React.MouseEvent,
16+
action: NotificationAction,
17+
) => {
18+
e.stopPropagation();
1519
if (!action.url) return;
1620

1721
try {
@@ -33,7 +37,7 @@ export function NotificationActions({ actions }: NotificationActionsProps) {
3337
variant={action.clear ? "ghost" : "outline"}
3438
size="sm"
3539
className="h-8 text-xs gap-1.5 transition-all duration-150 hover:bg-accent hover:shadow-sm active:scale-95"
36-
onClick={() => handleClick(action)}
40+
onClick={(e) => handleClick(e, action)}
3741
>
3842
{action.url && <ExternalLink className="h-3 w-3" />}
3943
{action.label}

0 commit comments

Comments
 (0)