Page MenuHomePhabricator

CategoryTree toggles cannot be reached by keyboard
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

What happens?:
You can't.

What should have happened instead?:
You can. And then pressing Enter/Return has the same effect as a mouse click.

Event Timeline

Change 992275 had a related patch set uploaded (by Nardog; author: Nardog):

[mediawiki/extensions/CategoryTree@master] Make the toggle reachable by keyboard

https://gerrit.wikimedia.org/r/992275

Change 992275 merged by jenkins-bot:

[mediawiki/extensions/CategoryTree@master] Make the toggle reachable by keyboard

https://gerrit.wikimedia.org/r/992275

Nardog claimed this task.

Why was it changed to <a role="button"> rather than a <button>? <a> is for things that go somewhere; this toggle does something.

You can just override the style of the <button> using CSS; it doesn’t have anything link-like in its styles anyway (no underlining, and, with this change, no blue color either – I’m not sure, by the way, if it was intentional, or just the side affect of the .CategoryTreeBullet a selector now kicking in).

This change also broke Cat-a-lot (and probably AC/DC as well) because it relies on the assumption that the first <a> in the <li> of the subcategory is the link to the subcategory – while the gadget could also be fixed, it would be more difficult (there’s no stable way of finding the real subcategory link), and as the link of CategoryTree is semantically incorrect (even though patched by the role attribute), I think it’s the extension that needs fixing.

<button> comes with its own quirks so I used <a>, but I wouldn't stop anyone from trying. In the meantime I suggest Cat-a-lot be patched anyway, as even if they did it wouldn't be deployed immediately.

@Nardog: Can you be more specific what kind of quirks are with <button> tag?

For one, it has to be styled basically from scratch to blend with text and not look like a button. And it would have to be inserted (or enabled) client-side.