Skip to content

refactor(material-experimental/mdc-form-field): align label setup with non-MDC version #24339

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

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 2, 2022

Aligns the floating label setup of the MDC-based form field with the non-MDC version for better accessibility and to allow for easier customization. Includes:

  • Moving the required asterisk into its own element.
  • Reducing the specificity of the label typography.

…h non-MDC version

Aligns the floating label setup of the MDC-based form field with the non-MDC version for better accessibility and to allow for easier customization. Includes:
* Moving the required asterisk into its own element.
* Reducing the specificity of the label typography.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels Feb 2, 2022
@crisbeto crisbeto requested a review from devversion February 2, 2022 13:14
@crisbeto crisbeto requested a review from mmalerba as a code owner February 2, 2022 13:14
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Is there any specific reason to switch away from how MDC renders the asterisk? If so, would it make sense landing such a change upstream as well/instead?

@crisbeto
Copy link
Member Author

crisbeto commented Feb 2, 2022

I submitted the PR, because we had an internal report that the targeting the asterisk is difficult, because of some lint rules that don't allow users to target MDC classes. It's also a potential accessibility issue, because there's no way to set aria-hidden on a pseudo element.

@devversion
Copy link
Member

Yeah that makes sense. I read that some screen readers will read the rendered pseudo-element content. Although what I'm trying to check is whether it would make sense to land such change upstream first before we just diverge even more (the form-field obviously diverges a lot anyway from the basic MDC textfield)

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM overall, if we want to go with that before MDC adjusts its docs/whatever else is involved.

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 3, 2022
@andrewseguin andrewseguin merged commit 88029be into angular:master Feb 18, 2022
andrewseguin pushed a commit that referenced this pull request Feb 18, 2022
…h non-MDC version (#24339)

Aligns the floating label setup of the MDC-based form field with the non-MDC version for better accessibility and to allow for easier customization. Includes:
* Moving the required asterisk into its own element.
* Reducing the specificity of the label typography.

(cherry picked from commit 88029be)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants