-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: main
Are you sure you want to change the base?
Conversation
🔭🐙🐈 Test this branch here: https://db-ux-design-system.github.io/core-web/review/fix-button-click-double-call |
…reserving native behavior
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 addresses the duplicate click events issue by refactoring the button component click handler to use the useTarget utility for framework-specific event handling, and updates the Angular configuration to reflect new experimental outputs settings for the click event.
- Updated the button component to use a spread from useTarget for handling onClick events in a framework-agnostic manner.
- Modified the Angular configuration to apply an experimental outputs mapping for 'click'.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/components/src/components/button/button.lite.tsx | Refactored onClick handling using useTarget to prevent duplicate click events |
packages/components/configs/angular/mitosis.config.cjs | Updated Angular config to include experimental outputs for click event mapping |
Comments suppressed due to low confidence (2)
packages/components/src/components/button/button.lite.tsx:55
- [nitpick] Consider adding an inline comment explaining the purpose of using useTarget for handling click events to aid future maintainers in understanding the framework-specific logic.
{...useTarget({
packages/components/configs/angular/mitosis.config.cjs:9
- [nitpick] Add a comment to explain the experimental outputs configuration and its intent to map the 'click' event, which will help clarify future updates or troubleshooting.
angular: {
@@ -7,6 +6,12 @@ module.exports = { | |||
targets: ['angular'], | |||
dest: '../../output/tmp', | |||
options: { | |||
angular | |||
angular: { | |||
experimental: { |
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.
@michaelmkraus you removed the settings for signals
api with this :(
Proposed changes
Types of changes
closes #4339