Use a button to show/hide password in the management area
When using a link, people using screen readers might think they're going to a new page where the password is going to be shown. With a button, they get a better idea about what to expect. Furthermore, with a button, we can use the `aria-pressed` attribute to indicate whether the password is currently being shown.
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
<div class="input-group">
|
||||
<%= f.password_field :password, class: "input-group-field", label: false, value: nil %>
|
||||
<span class="input-group-label">
|
||||
<a href="#" class="show-password">
|
||||
<button type="button" class="show-password" aria-pressed="false">
|
||||
<span class="icon-eye"></span>
|
||||
<span class="show-for-sr"><%= t("management.account.edit.password.show") %></span>
|
||||
</a>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user