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

fix(material/input): don't remove the placeholder attribute #22319

Closed
wants to merge 1 commit into from

Conversation

mmalerba
Copy link
Contributor

It was only removed to support the legacy form-field, and removing it
creates problems for other directives that may need to read it (e.g.
textarea autosize).

It was only removed to support the legacy form-field, and removing it
creates problems for other directives that may need to read it (e.g.
textarea autosize).
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 23, 2021
@crisbeto
Copy link
Member

It isn't really there to support the legacy appearance though, it's so that screen readers don't read out the same placeholder twice. I'm not sure that we can remove it without removing the legacy appearance. We could try to limit it further, but the _hideControlPlaceholder which it's based upon is already very narrow.

@mmalerba
Copy link
Contributor Author

Does this ever happen on form-fields that don't have the legacy appearance?

My understanding is that its purely for the sake of not reading the placeholder twice on the legacy form-field. If that's the case and we're ok with autosize possibly making the textarea smaller than the placeholder in the legacy form-field I can just close this. I've already updated #22314 to just test a different appearance

@crisbeto
Copy link
Member

It's only relevant in legacy, but I think that we'll have to keep it because it is still the default appearance for mat-form-field. Maybe in #22314 we could detect if the textarea is a MatInput and have it look at data-placeholder as well?

@mmalerba
Copy link
Contributor Author

I don't want to add any more cruft to support the legacy style. I'd rather just only support the placeholder in autosize for the newer appearances. I'll close this and just go ahead with the other PR without legacy support

@mmalerba mmalerba closed this Mar 25, 2021
@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 Apr 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants