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}}
<PasswordField
@value={{this.accountPassword}}
@type={{if this.maskPassword "password" "text"}}
@autocomplete="current-password"
@capsLockOn={{this.capsLockOn}}
type={{if this.maskPassword "password" "text"}}
autocomplete="current-password"
aria-describedby="password-validation password-validation-more-info"
aria-invalid={{this.passwordValidation.failed}}
id="new-account-password"

View File

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

View File

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

View File

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

View File

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