-
Notifications
You must be signed in to change notification settings - Fork 587
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: add current-checked attribute to checkable form controls #5326
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicholasrice
requested review from
awentzel,
chrisdholt,
EisenbergEffect,
Falkicon and
janechu
as code owners
October 26, 2021 23:22
β¦7.json remove un-needed change file
robarbms
reviewed
Oct 27, 2021
packages/web-components/fast-foundation/src/form-associated/form-associated.ts
Show resolved
Hide resolved
robarbms
reviewed
Oct 27, 2021
packages/web-components/fast-foundation/src/form-associated/form-associated.ts
Outdated
Show resolved
Hide resolved
janechu
reviewed
Oct 27, 2021
change/@microsoft-fast-foundation-770324f7-b3b0-46a2-8634-8e57f71d553b.json
Outdated
Show resolved
Hide resolved
packages/web-components/fast-foundation/src/radio/radio.form-associated.ts
Show resolved
Hide resolved
β¦f71d553b.json Co-authored-by: Jane Chu <7559015+janechu@users.noreply.github.com>
janechu
approved these changes
Oct 27, 2021
chrisdholt
approved these changes
Oct 27, 2021
robarbms
approved these changes
Oct 27, 2021
6 tasks
nicholasrice
added a commit
that referenced
this pull request
Nov 17, 2021
* adding and integrating CheckableFormAssociated * adding tests * add comments and cleanup * fixing callbacks so that they can be superd and invoked by the browser * Change files * Delete @microsoft-fast-foundation-23ec31a3-a8eb-42e2-9ad0-c96005a332a7.json remove un-needed change file * moving proxy setAttribute to constructor * add super call to formResetCallback * re-implementing class-adding bheavior * remove duplicate code * Update change/@microsoft-fast-foundation-770324f7-b3b0-46a2-8634-8e57f71d553b.json Co-authored-by: Jane Chu <7559015+janechu@users.noreply.github.com> * update API report Co-authored-by: nicholasrice <nicholasrice@users.noreply.github.com> Co-authored-by: Jane Chu <7559015+janechu@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
π Description
This PR is a follow-up to #5298 to support
checked
state mutability through HTML attributes.It adds a new TypeScript mixin,
CheckableFormAssociated
, to consolidate business logic of checkable controls into one centralized location. It then adds thecurrentChecked
property/attribute into that mixin, and integrates the mixin into theCheckbox
,Radio
, andSwitch
components.This PR also adjusts the implementation of the
formResetCallback
andformResetCallback
to be class methods instead of functions assigned during construction. The (HTML spec)[https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-api] requires these lifecycle methods to exist on the prototype in order to be invoked appropriately by the browser, so the implementation we had for these methods was incorrect and they were never being invoked directly by the browser.π« Issues
π©βπ» Reviewer Notes
π Test Plan
β Checklist
General
$ yarn change
Component-specific
β Next Steps