Search code examples
htmlwai-ariaaccessibility

Does role=progressbar cause confusion when used on a password-strength meter?


I'm working on a sign up form for a website and I wanted to include a password-strength meter which will be in the form of a progressbar widget.

Most examples I've seen set role=progressbar on the HTML element but that doesn't sound quite right to me according to the WAI Aria 1.1 recommendation:

An element that displays the progress status for tasks that take a long time.

A progressbar indicates that the user's request has been received and the application is making progress toward completing the requested action. [...]

Reading the above, I'd be enclined to omit the role attribute altogether as I didn't find any that match a "meter type" in the list of widget roles.

Is it better for users of assistive technology to have role=progressbar or does it cause confusion? Would it be better to omit it?


Solution

  • Traditionally in GUI applications, a progress bar isn't focusable and even sometimes totally invisible when navigating with a screen reader. It is only announced when its value changes, or periodically every x seconds. Additionally, the progress bar is there to show a percentage of progress, usually a value between 0% and 100%, and it isn't supposed to decrease.

    Therefore, in your case of password strength, as you have guessed, a progress bar is probably inappropriate for several reasons:

    • Even if we can perhaps assume that 0% is very weak and 100% is very strong, what does 60% means exactly ? quite good or just vaguely acceptable ? Like grades in school, your perception and perception of users vary, and it may not be very clear for everyone that 0% = very weak and 100% = very strong.
    • A progress bar is ment to represent a progress percentage, much less a serie of finite progressive qualifications like weak > acceptable > good > strong. ARIA requires that the value be a number, so you can't give the real piece of information the user needs.
    • Progress bar value is usually announced as it changes. Changes are pretty low that random numbers periodically announced as the password is typed are understood as being the strength of the password.
    • If I want to check the strength of my current password without changing it, the progress bar is of no help if it is invisible
    • The value of a progress bar isn't supposed to decrease. It isn't directly specified in ARIA, but it's kind of implied when it says "progression over time". However, your password strength can decrease while typing (or erasing) characters.

    For all the reasons above, I would rather advise you to don't use the progressbar role, and complement your progress bar with an ARIA live region, saying something like "Password strength: good" which is updated while typing.