Skip to content

Password component ToggleMask element is inaccessible #7956

@nsnyder

Description

@nsnyder

Describe the bug

The togglemask feature of the Password component is inaccessible via keyboard. I have attempted to use Passthroughs to make it work, but in addition to being very cumbersome (especially that I would have to manage focus since the changing icons loses focus of the current element), others would have to go through the same extended process to have an accessible component. And if they don't have the understanding, it will remain inaccessible.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

I may find time later, but am not super familiar with the code base in order to get up to speed at the moment.

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-crmgt8xd?file=src%2FApp.vue

Environment

Standard node environment, running in WSL 2/Ubuntu.

Vue version

3.4.31

PrimeVue version

4.3.1

Node version

20.19.1

Browser(s)

No response

Steps to reproduce the behavior

  1. Enter a password in the Password input
  2. Hit tab to focus the toggle mask icon
  3. See that the toggle mask icon is not focusable

Expected behavior

To my understanding, it should:

  1. Wrap the icon(s) with a button
  2. Listen to a click on that button (instead of the icon).
  3. Add an aria-label to the button which changes to "show password" or "hide password" depending on the current state.
  4. Remove the aria-hidden="true" from the current icon.

This would make it accessible via keyboard (currently only accessible via mouse).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions