Skip to content

Conversation

@joshenlim
Copy link
Member

@joshenlim joshenlim commented Aug 8, 2025

Context

If Button is used with a link element (e.g <Link> or <a>), users will still be redirected to the link upon clicking the button even if the button is disabled. The changes here should address that by preventing the redirect if the button is disabled

Although do let me know if I might be overlooking something here! 🙏

@joshenlim joshenlim requested a review from a team as a code owner August 8, 2025 09:11
@vercel
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
studio-self-hosted ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
ui-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
zone-www-dot-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 9:34am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cms ⬜️ Ignored (Inspect) Aug 8, 2025 9:34am
studio ⬜️ Ignored (Inspect) Aug 8, 2025 9:34am

@supabase
Copy link

supabase bot commented Aug 8, 2025

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@joshenlim joshenlim requested a review from a team as a code owner August 8, 2025 09:26
@joshenlim joshenlim changed the title ButtonTooltp to add preventDefault onClick if disabled Button to add preventDefault onClick if disabled Aug 8, 2025
import { cloneElement, forwardRef, isValidElement } from 'react'
import { SIZE_VARIANTS, SIZE_VARIANTS_DEFAULT } from '../../lib/constants'
import { cn } from '../../lib/utils/cn'
import { IconContext } from '../Icon/IconContext'
Copy link
Member Author

Choose a reason for hiding this comment

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

wasn't being used

@coveralls
Copy link

Coverage Status

coverage: 16.824% (-54.3%) from 71.086%
when pulling 7a8e5af on chore/buttontooltip-add-prevent-default-onclick-if-disabled
into d60aceb on master.

Copy link
Member

@alaister alaister left a comment

Choose a reason for hiding this comment

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

LGTM!

  • Tested on preview

@joshenlim joshenlim merged commit f927998 into master Aug 12, 2025
19 of 22 checks passed
@joshenlim joshenlim deleted the chore/buttontooltip-add-prevent-default-onclick-if-disabled branch August 12, 2025 06:42
PLyn pushed a commit that referenced this pull request Aug 25, 2025
* ButtonTooltp to add preventDefault onClick if disabled

* Update base component Button instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants