Skip to content

Commit

Permalink
Fix: Add e.preventDefault() to prevent page reload (shadcn-ui#2278)
Browse files Browse the repository at this point in the history
Fixes shadcn-ui#2277

Add `e.preventDefault()` to prevent page reload in mail component

![image](https://github.com/shadcn-ui/ui/assets/106688422/d1373e8f-0c46-4f2e-8caf-2fcd2076b2fb)
  • Loading branch information
jrTilak authored Jan 7, 2024
1 parent a3cd9fe commit 4119555
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/www/app/examples/mail/components/mail-display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ export function MailDisplay({ mail }: MailDisplayProps) {
<Switch id="mute" aria-label="Mute thread" /> Mute this
thread
</Label>
<Button size="sm" className="ml-auto">
<Button
onClick={(e) => e.preventDefault()}
size="sm"
className="ml-auto"
>
Send
</Button>
</div>
Expand Down

0 comments on commit 4119555

Please sign in to comment.