-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 show password button on the login screen (Lombiq Technologies: OCORE-172) #16098
Conversation
@@ -23,7 +23,7 @@ | |||
|
|||
<script at="Foot"> | |||
togglePassword = document.querySelector('#togglePassword'); | |||
password = document.querySelector('#Password'); | |||
password = document.querySelector('#@Html.IdFor(m => m.Password)'); |
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.
Please add the directive let
before password and togglePassword. These are local variables
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.
What are the difference except the intellisense, both have "#Password" value
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.
The old hard-coded ID that the script depended on was Password
but the new one generated by asp-for="Password"
is LoginForm_Password
. This is why the script was broken.
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.
It may not be a bad idea to also use model binding to create the toggler ID too this way it's consistent. Either way, I approve feel free to merge or update then merge
I think that can remain; It's a single-use element that doesn't have a corresponding member in the view model. Thanks both! |
I checked for similar issues but this seems to be the only one.
This is a regression post-1.8.