-
Notifications
You must be signed in to change notification settings - Fork 211
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
chore(checkbox): declare change event in customer-elements.json #3061
Conversation
Tachometer resultsChromecard permalink
checkbox permalink
split-view permalink
switch permalink
table permalink
Firefoxcard permalink
checkbox permalink
split-view permalink
switch permalink
table permalink
|
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.
Looks good to me, but could you help me understand the underlying situation a bit better here?
Specifically, change
is a native event, does React really not allow users to bing onChange
to any element? Does it have something to do with <SpCheckbox>
not actually being the <sp-checkbox>
element so it gets confused from an event bubbling perspective? Or maybe because we dispatch a Custom Event called change
?
As we develop a better root understanding of the relationship between our HTML elements and the React components that wrap them we can do a better job of developing, reviewing, or tooling the code to ensure things like this are included system wide and not just each time we run into something that you or another client specifically needs in the moment.
According to the React doc(old and new), |
Hi @Westbrook, I'm afraid I'm confusing the typescript type issue between swc react wrapper and my own nextjs wrapper. React Synthetic event should be able to apply to all the |
Hi @Westbrook,
For react wrapper code generation to work, we have to explicit declare it as an event. I also audited the whole code base and found another missing declaration in [SplitView] ( spectrum-web-components/packages/split-view/src/SplitView.ts Lines 403 to 409 in d4e49f5
|
44bd0ef
to
b16a749
Compare
b16a749
to
63018fb
Compare
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.
Got it! LGTM. 🙇🏼
Next release may not be till next week, but you'll see it in the channel when it comes.
Description
It looks like the customer-elements.json for
Checkbox
component hasn't mentioned itschange
event.Related issue(s)
N/A
Motivation and context
There is no
change
event declaration in customer-elements.json which cause @swc-react/checkbox component is unable to supportchange
event callback.How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.