-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab order based on distance from center #596
Conversation
@prushforth |
My first impression is that the map should always come first. It would be acceptable to skip the controls and go straight to the features, maybe. |
To get this behavior you either have to;
|
I think 2 is the only option, we don't want to break the tab order of elements on people's websites. |
Would this be compatible with #571? |
No I believe that's getting shelved for now |
Could we establish a private focus order index value that we follow, instead of setting the tabindex > 0? We could handle keystrokes while in a sequence of features and set focus to the next highest/ next lowest private focus order index, perhaps |
I was looking for where @Malvoz mentioned using arrow keys instead of tab keys within a group of features. If we implemented that, we wouldn't be hacking the tabindex, I think. |
So, I think we should be using tabindex=-1 and setting a private focus index value that we programmatically use to set the focus on a feature. The private value can be ordered ascending by distance?? Maybe the first feature in the DOM should be tabindex=0 and the rest -1? WDYT? |
That would work, does handling the tab event ourselves have any benefit over adding tabindex when the map is focused and removing it once the map is out of focus? |
Good question, but if we don't change the tabimdex in an antisocial way, it won't matter if our program crashes and can't change it back? Maybe |
Maybe the first feature in each layer should be tabindex=0, with the rest =-1... |
2021-11-27.14-37-56.mp4So I opted to use event handlers as this would also further improvements in the future brought up by @prushforth regarding arrow keys. All the features in the map are considered rather than on a per layer basis. The highest The final thing remaining is treating subparts (spans within coordinates) as independent when sorting, currently it treats subparts distance from the center as equal to the distance of the main component. |
The functionality should be reviewed before the tests are updated to reflect the new behavior. So if anyone has time please share any feedback or bugs. |
Looking pretty nice! A couple of things I noticed.
I'll continue to look for stuff.... |
@prushforth The issues you mentioned should be fixed with the latest update, good finds! |
@ahmadayubi the issues seem mostly fixed. I was able to reproduce the first problem:
but not as bad, by first loading the restaurants, then tabbing through them, then zooming in and tabbing a few times, then right-click the restaurants layer entry and press "Zoom to layer". The multiple-tabs-to-get-past-a-marker problem occurs. |
Hmm okay, it's related to the layer removal, I thought I accounted for it but maybe different map updates run through different removal paths. Will take a look. |
@prushforth Turns out the reason it needed multiple tab presses is because the features are duplicated in the DOM. The bug is related to |
I have a feeling that might be due to a change I made during template features processing. So it's an unrelated bug to this. |
Hopefully won't mess up history too badly, should get overwritten when that PR is merged.
Hopefully won't mess up history too badly, should get overwritten when that PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This change on its own would make it difficult for screen reader users to discover that new features have become available after pan/zoom, but it's an important piece of the puzzle. And it all comes together with #636.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. When tabbing through many features, we do need a way to skip to the end of the sequence so as to not trap the user. This may come into play with feature indexing too. I look forward to implementing arrow key feature navigation as a way of leaving tabs to inter-control/interactive element navigation.
Boom! |
…e linking example. (#92) * Update dist to pre-integrate work from Maps4HTML/MapML.js#596 Hopefully won't mess up history too badly, should get overwritten when that PR is merged. * [AUTO] Sync MapML Build * [AUTO] Sync MapML Build * Share restaurants across examples. Add tabindex to building part example. Update RTL experiment to use shared restaurants.mapml
2021-11-24.14-29-04_Trim.mp4
Closes #385