-
Notifications
You must be signed in to change notification settings - Fork 561
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
[Site] Fix mobile tabindex #5426
Conversation
Fixes VSO 30943285
Hi @paulcam206. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes. |
Heh. This will do it i guess, but is there a way to like log a bug against whoever does own the bad script so that someday eventually their script will be less broken? |
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.
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.
If we have less than 5 pending accessibility issues, we should consider waiting for a proper UHF fix instead. Either that, or track a new issue to change it.
@@ -595,6 +595,20 @@ $(function () { | |||
// Kick off one resize to fix all videos on page load | |||
}).resize(); | |||
|
|||
function makeTabIndicesZero() { |
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.
Perhaps we should only make the indices zero if they're not set to a negative number? This way, if anything was explicitly removed from tab order, we don't change those.
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.
that's a good point -- fix inbound shortly
unfortunately, I don't think we can count on a fix coming any time soon. we're basically using a cobbled-together UHF drop, so we're not likely to be in a supported config. that said, we should probably file an issue to modernize our UHF consumption. I'll do that. :) |
Related Issue
Fixes VSO 30943285
Description
I apologize in advance. Header and mobile nav is powered by some JS we don't own (and can't change on any reasonable time scale). There are a couple of problems with this script. The first is that it puts explicit positive
tabindex
attributes on some DOM elements when in what it considers to be a "mobile" view (this is keyed off of the window width, so it is also affected by DPI and zoom levels). Using positivetabindex
values is considered bad practice because it's easy to get wrong. Anyways, this is the reason why the tab order is messed up in mobile. The second (relatively minor) problem is that it views the templating checkbox as a search box (it just looks for the first<input />
in the DOM).The fix reads easy enough, but I'm not proud of it (though it works):
tabindex="0"
to the templating checkbox to give it a reasonable default.makeTabIndicesZero()
, which finds everything on the page that has atabindex
property, and then sets that property to0
as it should be.makeTabIndicesZero()
on window resize (covers active zooming case).makeTabIndicesZero()
on document load, but do it behind asetTimeout
call so that it runs after the offending JS. This is the part I'm least happy about, but the offending JS is itself being run something likesetTimeout(ruinSomeTabIndices, 4);
(yes,4
).How Verified
Microsoft Reviewers: Open in CodeFlow