Skip to content
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

feat(Switch): enable support for form-associated #1368

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Conversation

dgonzalezr
Copy link
Collaborator

@dgonzalezr dgonzalezr commented Dec 10, 2024

Description

This PR enables support for form-associated custom elements, allowing them to participate in HTML forms:

https://stenciljs.com/docs/forms#using-form-associated-custom-elements
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals

To attach the component to a form, users need to do so manually. With this PR, users only need to be aware of setting the component name attribute/property to be linked to the form.

Related Issue

N/A

Documentation

Screenshots (if applicable)

CleanShot 2024-12-10 at 14 43 39

CleanShot 2024-12-11 at 13 02 29

CleanShot.2024-12-10.at.14.44.08.mp4

Checklist

  • I have read the CONTRIBUTING document.
  • I have read the CODE OF CONDUCT document.
  • I have reviewed my code.
  • I have tested the changes locally.
  • I have updated the documentation (if applicable).
  • I have added unit tests and e2e tests (if applicable).
  • I have requested reviews from relevant team members.

Additional Notes

@dgonzalezr dgonzalezr added the feature 🛠 New feature or request label Dec 10, 2024
Cata1989
Cata1989 previously approved these changes Dec 10, 2024
Cata1989
Cata1989 previously approved these changes Dec 11, 2024
@dgonzalezr dgonzalezr merged commit 008b5a2 into main Dec 11, 2024
7 checks passed
@dgonzalezr dgonzalezr deleted the feat/switch branch December 11, 2024 12:00
@@ -150,6 +173,20 @@ export class BqSwitch {
}
}

formAssociatedCallback() {
console.log('formAssociatedCallback...');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log('formAssociatedCallback...');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🛠 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants