-
Notifications
You must be signed in to change notification settings - Fork 6.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
feat(material-experimental): initial prototype of mdc-form-field #17903
Conversation
bb8d163
to
9bce312
Compare
9bce312
to
4b258ac
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.
I got about halfway through before I have to head out for the day; will try to finish tomorrow
Can you file an issue on the MDC repo for the challenges with prefix/suffix? I know their team is planning on supporting this soon, so we should make our requirements known
cc @abhiomkar
src/material-experimental/mdc-form-field/_form-field-variables.scss
Outdated
Show resolved
Hide resolved
4b258ac
to
136d6c5
Compare
@jelbourn I created material-components/material-components-web#5326 for the outline appearance prefix/suffix issue (and linked to it in the Sass where needed) |
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.
src/material-experimental/mdc-form-field/_mdc-text-field-structure-overwrites.scss
Outdated
Show resolved
Hide resolved
src/material-experimental/mdc-form-field/_mdc-text-field-structure-overwrites.scss
Outdated
Show resolved
Hide resolved
src/material-experimental/mdc-form-field/_form-field-variables.scss
Outdated
Show resolved
Hide resolved
* Sets the list of element IDs that describe the child control. This allows the control to update | ||
* its `aria-describedby` attribute accordingly. | ||
*/ | ||
private _syncDescribedByIds() { |
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.
Would using AriaDescriber
simplify this method at all?
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.
I don't think so. We want to use existing DOM elements and the actual custom form-field control is responsible for setting them. We just pass the hint/error id's down to the registered control.
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.
Still reviewing, but here's a couple comments I had so far
src/material-experimental/mdc-form-field/_form-field-standard-appearance.scss
Outdated
Show resolved
Hide resolved
src/material-experimental/mdc-form-field/_form-field-bottom-line.scss
Outdated
Show resolved
Hide resolved
src/material-experimental/mdc-form-field/_mdc-text-field-structure-overwrites.scss
Outdated
Show resolved
Hide resolved
For reference: Theming and colors are inaccurate since we do not have feature targeting yet. Without feature targeting I cannot wrap the MDC text-field styles in the theming mixin (limitation of Sass) |
631fd63
to
c728167
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.
I hope that we'll be able to make some changes in MDC over time to reduce the number of workaround needed, but this looks good to me as a first pass.
Also, amazing work on this! Thank you for the detailed comments and explanations!
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.
LGTM
Your comments in this PR are great; they could be in a textbook about good comments.
@jelbourn Thanks for bringing this up! I sent you a note internally for potential changes to text field for prefix / suffix support. |
Initial prototype of form-field based on MDC text-field.
28f6c54
to
0940afe
Compare
0940afe
to
09d5790
Compare
…lar#17903) * feat(material-experimental): initial prototype of mdc-form-field Initial prototype of form-field based on MDC text-field. * fixup! feat(material-experimental): initial prototype of mdc-form-field Address feedback * Use MDC text-field variables as much as possible. * fixup! fixup! feat(material-experimental): initial prototype of mdc-form-field Address feedback 2 * fixup! feat(material-experimental): initial prototype of mdc-form-field Address feedback
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Creates the initial prototype of form-field based on MDC text-field.
A few things that required some special handling in terms of extra CSS:
input
andtextarea
. We want them to work always and to also cover prefixes and suffixes.Based on demo comparisons and unit test comparisons there are no breaking changes in terms of API and features, except that prefixes and suffixes do not work properly in the outline appearance. This requires some more thoughts and most likely upstream changes in MDC text-field. I could imagine this being something we can tackle in follow-ups's as the PR is already quite large.