I have a create password form that looks like the following:
As you can see from the image, the reveal password button (eye icon) is the next sequential thing for the browser to focus. As such, without explicitly adding
tabindex attributes to the fields, the order of focus will be:
- Current password input
- Reveal current password
- New password input
- Reveal new password
When I use this, I find it slightly irritating (I want tab to take me to the next input). As such, I'm tempted to change the tab index so that the reveal password buttons are selected last (after all inputs and the change password button), but I feel like this is a choice informed by my own habits/preferences rather than anything else.
The MDN docs suggest:
Avoid using tabindex values greater than 0. Doing so makes it difficult for people who rely on assistive technology to navigate and operate page content. Instead, write the document with the elements in a logical sequence.
I assume it would be arrogant to consider this form an exception?
Interested to gather people's opinions on this one.