DEV: Use autocomplete="new-password" (#25913)

And normalize `<PasswordField />` arguments

(we were getting `[DOM] Input elements should have autocomplete attributes (suggested: "current-password")` in smoke test logs, this may or may not fix that 😛)
This commit is contained in:
Jarek Radosz 2024-02-27 13:29:12 +01:00 committed by GitHub
parent 64e8ad170e
commit f44bee1333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 14 deletions

View File

@ -137,9 +137,9 @@
{{#if this.passwordRequired}} {{#if this.passwordRequired}}
<PasswordField <PasswordField
@value={{this.accountPassword}} @value={{this.accountPassword}}
@type={{if this.maskPassword "password" "text"}}
@autocomplete="current-password"
@capsLockOn={{this.capsLockOn}} @capsLockOn={{this.capsLockOn}}
type={{if this.maskPassword "password" "text"}}
autocomplete="current-password"
aria-describedby="password-validation password-validation-more-info" aria-describedby="password-validation password-validation-more-info"
aria-invalid={{this.passwordValidation.failed}} aria-invalid={{this.passwordValidation.failed}}
id="new-account-password" id="new-account-password"

View File

@ -32,16 +32,16 @@
</div> </div>
<div class="input-group"> <div class="input-group">
<PasswordField <PasswordField
{{on "keydown" this.loginOnEnter}}
@value={{@loginPassword}} @value={{@loginPassword}}
@type={{if this.maskPassword "password" "text"}} @capsLockOn={{this.capsLockOn}}
class={{value-entered @loginPassword}} type={{if this.maskPassword "password" "text"}}
id="login-account-password" disabled={{this.disableLoginFields}}
autocomplete="current-password" autocomplete="current-password"
maxlength="200" maxlength="200"
@capsLockOn={{this.capsLockOn}}
disabled={{this.disableLoginFields}}
tabindex="1" tabindex="1"
{{on "keydown" this.loginOnEnter}} id="login-account-password"
class={{value-entered @loginPassword}}
/> />
<label class="alt-placeholder" for="login-account-password"> <label class="alt-placeholder" for="login-account-password">
{{i18n "login.password"}} {{i18n "login.password"}}

View File

@ -137,9 +137,10 @@
<div class="input password-input input-group"> <div class="input password-input input-group">
<PasswordField <PasswordField
@value={{this.accountPassword}} @value={{this.accountPassword}}
@type={{if this.maskPassword "password" "text"}}
@id="new-account-password"
@capsLockOn={{this.capsLockOn}} @capsLockOn={{this.capsLockOn}}
type={{if this.maskPassword "password" "text"}}
autocomplete="new-password"
id="new-account-password"
class={{value-entered this.accountPassword}} class={{value-entered this.accountPassword}}
/> />
<label class="alt-placeholder" for="new-account-password"> <label class="alt-placeholder" for="new-account-password">

View File

@ -64,10 +64,11 @@
<div class="input"> <div class="input">
<PasswordField <PasswordField
@value={{this.accountPassword}} @value={{this.accountPassword}}
@type={{if this.maskPassword "password" "text"}}
@id="new-account-password"
@capsLockOn={{this.capsLockOn}} @capsLockOn={{this.capsLockOn}}
@autofocus="autofocus" type={{if this.maskPassword "password" "text"}}
autofocus="autofocus"
autocomplete="new-password"
id="new-account-password"
/> />
<TogglePasswordMask <TogglePasswordMask
@maskPassword={{this.maskPassword}} @maskPassword={{this.maskPassword}}

View File

@ -3,7 +3,7 @@
</StyleguideExample> </StyleguideExample>
<StyleguideExample @title="password"> <StyleguideExample @title="password">
<PasswordField @type="password" @placeholder="Placeholder" /> <PasswordField type="password" placeholder="Placeholder" />
</StyleguideExample> </StyleguideExample>
<StyleguideExample @title="textarea"> <StyleguideExample @title="textarea">