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 show password button on the login screen (Lombiq Technologies: OCORE-172) #16098

Merged
merged 3 commits into from
May 19, 2024

Conversation

Piedone
Copy link
Member

@Piedone Piedone commented May 19, 2024

I checked for similar issues but this seems to be the only one.

This is a regression post-1.8.

@Piedone Piedone added this to the 2.0 milestone May 19, 2024
@Piedone Piedone requested a review from MikeAlhayek May 19, 2024 02:25
@@ -23,7 +23,7 @@

<script at="Foot">
togglePassword = document.querySelector('#togglePassword');
password = document.querySelector('#Password');
password = document.querySelector('#@Html.IdFor(m => m.Password)');
Copy link
Member

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

Copy link
Member

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

Copy link
Member Author

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.

@Piedone Piedone requested a review from MikeAlhayek May 19, 2024 18:49
@Piedone Piedone changed the title Fix show password button on the login screen Fix show password button on the login screen (Lombiq Technologies: OCORE-172) May 19, 2024
Copy link
Member

@MikeAlhayek MikeAlhayek left a 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

@Piedone
Copy link
Member Author

Piedone commented May 19, 2024

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!

@Piedone Piedone merged commit 786f9ba into OrchardCMS:main May 19, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants