Fix spacebar key triggering action link in alert popups (#2339)
This commit is contained in:
@@ -25,15 +25,17 @@ export const AlertBox = ({ alert, className }: AlertBoxProps) => {
|
|||||||
<div className="flex flex-col gap-2 flex-1">
|
<div className="flex flex-col gap-2 flex-1">
|
||||||
<span className="text-[11px] break-words whitespace-pre-line">{alert.message}</span>
|
<span className="text-[11px] break-words whitespace-pre-line">{alert.message}</span>
|
||||||
{alert.action && (
|
{alert.action && (
|
||||||
<button
|
<a
|
||||||
|
role="button"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
alert.action?.onClick();
|
alert.action?.onClick();
|
||||||
}}
|
}}
|
||||||
className="text-[11px] text-left underline hover:opacity-80 cursor-pointer outline-none"
|
className="text-[11px] text-left underline hover:opacity-80 cursor-pointer outline-none"
|
||||||
>
|
>
|
||||||
{alert.action.text}
|
{alert.action.text}
|
||||||
</button>
|
</a>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user