Fix spacebar key triggering action link in alert popups (#2339)

This commit is contained in:
Zane
2025-04-24 09:34:28 -07:00
committed by GitHub
parent 05fef9073f
commit bc4adc2ec9

View File

@@ -25,15 +25,17 @@ export const AlertBox = ({ alert, className }: AlertBoxProps) => {
<div className="flex flex-col gap-2 flex-1">
<span className="text-[11px] break-words whitespace-pre-line">{alert.message}</span>
{alert.action && (
<button
<a
role="button"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
alert.action?.onClick();
}}
className="text-[11px] text-left underline hover:opacity-80 cursor-pointer outline-none"
>
{alert.action.text}
</button>
</a>
)}
</div>
</div>