-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
(web-components) Use ElementInternals for Checkbox component #31468
(web-components) Use ElementInternals for Checkbox component #31468
Conversation
📊 Bundle size report✅ No changes found |
change/@fluentui-web-components-3b549149-2c12-435b-b925-e79f4fb05730.json
Show resolved
Hide resolved
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
58c0852
to
1e65155
Compare
1e65155
to
fb2db45
Compare
fb2db45
to
84a58cf
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.
Great work! 🙌 I do have a general question/thought. I know the objective was to covert this to elementInternals
but it seems like the amount of script for a fluent-checkbox has increased ~4x.
I don't think it's a blocker but any thoughts there? Maybe there's a future abstraction like a FASTFormAssociatedElement
base class that pulls out of some the boilerplate?
@davatron5000 It's an optical illusion 🌫️ The original
The |
84a58cf
to
8a660aa
Compare
e333255
to
8fb2887
Compare
…ft#31468) - Adds the `<fluent-field>` component - Fixes focus delegation in `<fluent-text-input>`
Previous Behavior
Currently, form-associated custom elements use the
FormAssociated
class mixin. This mixin is heavy and duplicative, being copied wholesale for every component which utilizes it. WhileFormAssociated
includes minimal support forElementInternals
, the implementation isn't fully baked.New Behavior
Improvements:
<fluent-checkbox>
custom element to useElementInternals
by default. An optional polyfill may be added in the near future, as more components transition to useElementInternals
.<fluent-field>
custom element to handle layout and label management. Most elements have a heavy template which includes a slotted<label>
due to cross-root ARIA not existing yet. The<fluent-field>
component allows for better composition, and makes each individual input-style component lighter and more performant.