Skip to content

Commit

Permalink
Fix: Add e.preventDefault() to prevent page reload (#2278)
Browse files Browse the repository at this point in the history
Fixes #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 fb614ac commit 3379542
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

1 comment on commit 3379542

@vercel
Copy link

@vercel vercel bot commented on 3379542 Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./apps/www

ui-git-main-shadcn-pro.vercel.app
example-playground.vercel.app
ui.shadcn.com
ui-shadcn-pro.vercel.app

Please sign in to comment.