-
Notifications
You must be signed in to change notification settings - Fork 11
fix(button): Prevent duplicate click events across frameworks while preserving native behaviour #4359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔭🐙🐈 Test this branch here: https://db-ux-design-system.github.io/core-web/review/fix-button-click-double-call |
…reserving native behavior
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes click event handling by removing per-component click logic and introducing a Mitosis plugin to apply it across framework targets.
- Strip out local
useStore
click handler and inlineonClick
bindings fromDBLink
andDBButton
- Add a shared
on-click
plugin to Vue, React, Angular, and Stencil configs - Consolidate TypeScript option under
commonOptions
inmitosis.config.cjs
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/components/src/components/link/link.lite.tsx | Removed local click state and inline onClick binding |
packages/components/src/components/button/button.lite.tsx | Removed local click state and inline onClick binding |
packages/components/configs/vue/index.cjs | Added onClickPlugin to Vue Mitosis config |
packages/components/configs/stencil/index.cjs | Added onClickPlugin to Stencil Mitosis config |
packages/components/configs/react/index.cjs | Added onClickPlugin to React Mitosis config |
packages/components/configs/angular/index.cjs | Added onClickPlugin to Angular Mitosis config |
packages/components/configs/mitosis.config.cjs | Introduced commonOptions.typescript for all targets |
Comments suppressed due to low confidence (1)
packages/components/src/components/link/link.lite.tsx:7
- The
useStore
import is no longer used after removing the click handler logic; consider removing it.
} from '@builder.io/mitosis';
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed changes
Types of changes
closes #4339