Skip to content

Fix the lack of tab/focus for password indicators, and add aria-live to it and maxLength.#256

Merged
MelissaAutumn merged 3 commits intomainfrom
bugs/250-fix-password-indicator-a11y-issues
Apr 10, 2026
Merged

Fix the lack of tab/focus for password indicators, and add aria-live to it and maxLength.#256
MelissaAutumn merged 3 commits intomainfrom
bugs/250-fix-password-indicator-a11y-issues

Conversation

@MelissaAutumn
Copy link
Copy Markdown
Member

@MelissaAutumn MelissaAutumn commented Apr 10, 2026

Fixes #250

Will need some german l10n from @devmount here. 😅

This makes password indicator tabbable which fixes the a11y issue. For a better time I added aria-polite and adjusted the v-ifs to avoid losing element focus when the indicator changes.

I also added a custom aria label for maxLength which works quite well.

@MelissaAutumn MelissaAutumn marked this pull request as ready for review April 10, 2026 17:40
Copy link
Copy Markdown
Contributor

@davinotdavid davinotdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! The a11y related changed looks good to me but some questions on the boolean handling

Comment on lines +161 to +162
<eye-icon class="icon" alt="" v-if="passwordIsVisible === true" />
<eye-off-icon class="icon" alt="" v-else-if="passwordIsVisible === false" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could shorten this to

Suggested change
<eye-icon class="icon" alt="" v-if="passwordIsVisible === true" />
<eye-off-icon class="icon" alt="" v-else-if="passwordIsVisible === false" />
<eye-icon class="icon" alt="" v-if="passwordIsVisible" />
<eye-off-icon class="icon" alt="" v-else />

:title="passwordIndicatorText"
@keyup.space="togglePasswordVisibility"
@click="togglePasswordVisibility"
v-if="passwordIsVisible !== null"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, I believe this would be enough instead

Suggested change
v-if="passwordIsVisible !== null"
v-if="isPasswordField"

// The current inputType, this will swap between text and password.
const inputType = ref(props.type);
// false: hide password, true: show password
const passwordIsVisible = ref(isPasswordField ? false : null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
const passwordIsVisible = ref(!isPasswordField);

instead?

Comment on lines +113 to +117
if (passwordIsVisible.value === true) {
passwordIndicatorText.value = hidePasswordText;
} else if (passwordIsVisible.value === false) {
passwordIndicatorText.value = showPasswordText;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we eliminate the true / false / null to use isPasswordField and passwordIsVisible we could do:

Suggested change
if (passwordIsVisible.value === true) {
passwordIndicatorText.value = hidePasswordText;
} else if (passwordIsVisible.value === false) {
passwordIndicatorText.value = showPasswordText;
}
passwordIndicatorText.value = passwordIsVisible.value ? hidePasswordText : showPasswordText

@MelissaAutumn
Copy link
Copy Markdown
Member Author

We should punt that to a different ticket as the current method of using true, false and null as separate values is a separate issue and requires additional testing here.

@MelissaAutumn
Copy link
Copy Markdown
Member Author

Created #257

Copy link
Copy Markdown
Collaborator

@devmount devmount left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for this! I added the missing German bits from this PR and sneaked in one that was missing for a longer time apparently 😇

@devmount
Copy link
Copy Markdown
Collaborator

Also: This PR has a nice round PR number of 256 😍

@MelissaAutumn MelissaAutumn merged commit 64cd14e into main Apr 10, 2026
3 checks passed
@MelissaAutumn MelissaAutumn deleted the bugs/250-fix-password-indicator-a11y-issues branch April 10, 2026 19:48
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.

Password visibilty button is not tabbable

3 participants