krautzource / aria-tree-walker

A lightweight walker for labeled ARIA trees
https://krautzource.github.io/aria-tree-walker/
Apache License 2.0
2 stars 0 forks source link

possible focus trap #45

Open pkra opened 3 years ago

pkra commented 3 years ago

I saw an instance where a nested link led to a focus trap (on Chrome but not Firefox). Needs investigation.

pkra commented 3 years ago

This is particular to the MathJax examples. Here's what I think is happening.

I see this Chrome, FF, WebKit now that I understand it.

On the one hand, it's luckily not a complete trap since the last link will allow TABbing out (for AT users, focus can move past the tree in browse mode anyway).

But this needs fixing.

More generally, we should probably check if focus is moved to somewhere in the tree (e.g., a deep link) in which case we might want to resume navigation from the nearest tree item.

pkra commented 3 years ago

The quick and dirty solution would be to remove anchors in the tree from the taborder. If the link is a tree item, it can be reached. Otherwise, it's probably not really a tree.

pkra commented 3 years ago

More generally, we should probably check if focus is moved to somewhere in the tree (e.g., a deep link) in which case we might want to resume navigation from the nearest tree item.

Note to self. FF doesn't seem to focus correctly, Chrome does seem to.