-
Notifications
You must be signed in to change notification settings - Fork 952
fix(textfield): browser autocomplete works outside of a form #5617
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(textfield): browser autocomplete works outside of a form #5617
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Can you revert all formatting changes? Try not to run a formatter like prettier on our files, since it may not match our internal formatting requirements.
Thanks!
textfield/internal/text-field.ts
Outdated
@@ -604,6 +609,7 @@ export abstract class TextField extends textFieldBaseClass { | |||
aria-invalid=${this.hasError} | |||
aria-label=${ariaLabel} | |||
autocomplete=${autocomplete || nothing} | |||
name=${this.name} |
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.
Can you add || nothing
to not render the name attribute when none is provided?
name=${this.name || nothing}
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.
Thanks for the comments. PR updated as advised.
4b59ef6
to
ba5201b
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.
Awesome!
0502b47
into
material-components:main
Add name attribute to input and textarea elements created by the text-filed element.
This enables autocomplete to work int he browser even if a form is not used.
Discussed in issue #4589