Skip to content
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

Fix (most) accessibility issues found by recent scan #6215

Merged
merged 20 commits into from
Aug 8, 2018

Conversation

scottbommarito
Copy link
Contributor

@scottbommarito scottbommarito commented Jul 26, 2018

#6152

This PR fixes the following issues:

635011 - "Skip to Content" link loses tab order
My solution here was to write a script that sets the focus on first element in the content that can be tabbed to.

636482 - Discontinued login modal dialog does not set focus correctly

636486 - Register new certificate button does not respond to keyboard events

638489 - Recaptcha badge in contact forms tab order is incorrect
(note: this currently does not fix the issue due to a bug in Recaptcha)

638490 - Browse for readme button does not respond to keyboard events

643610 / 644048 - Links that are styled like buttons are displaying like links in high contrast mode

643613 - Profile page "delete user" link tab order is incorrect
My solution here was to change the "delete user" text into an icon alongside the "manage account" breadcrumb.
image

643615 - Email notifications form label name is incorrect

643617 - Profile page "manage my organizations" breadcrumb should read the number of organizations you own

644030 - Owner dropdown in upload form should read correctly in screenreader

644070 - Number of packages returned in search should be announced by screenreader

Functional - "Cancel" buttons do not work on the Account Settings page.

@@ -10,7 +10,8 @@
"[email protected]"
],
"ForceTransformationToOrganizationForEmailAddresses": [
"[email protected]"
"[email protected]",
"[email protected]"
],
"EnabledOrganizationAadTenants": [
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noooo.. don't commit these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yeah i fixed this like <5 min later

Copy link
Contributor

@shishirx34 shishirx34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo config changes.

@@ -10,6 +10,8 @@
_addCertificateUrl = addCertificateUrl;
_getCertificatesUrl = getCertificatesUrl;

window.nuget.configureFileInputButton("register-new");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe useful to add accessibility comments - so we don't accidentally revert? Would also help w/ review(s).

// Accessibility: register new certificate button should respond to keyboard events
window.nuget.configureFileInputButton("register-new");

});
}

configureSection(sections[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So only ManageOrganizations view had working cancel buttons? This extends it to others (SignIn, Account, Packages)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most cancel buttons on the site worked. This was specifically an issue between Manage Organizations and Account Settings. When those pages were de-duped we must have accidentally forgot that the script that configures the cancel buttons needed to be placed on both individually.

(isElement("input") && element.attr("type") !== "hidden") ||
(isElement("menu") && element.attr("type") !== "toolbar") ||
(isElement("object") && hasAttribute("usemap")) ||
(isElement("video") && hasAttribute("controls")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe isElement should be defined off nuget too?

Could also introduce nuget.isTabbableElement(e) for the logic in this return statement, and possibly `nuget.IsAlwaysInteractiveElement(e) for the above logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isElement captures the element that was passed into canElementBeTabbedTo so it can't be on nuget (same with hasAttribute)

I want to avoid adding too many unnecessary functions to nuget. To be honest, I wasn't going to add canElementBeTabbedTo or getFirstChildThatCanBeTabbedTo but I thought the code looked much cleaner with them defined outside of the $(#skipToContent) click handler code. In the future if we determine we need to use parts of this implementation elsewhere, we can quickly make the change to split these methods then.

}

// See https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Interactive_content
var alwaysInteractiveElements = ['a', 'button', 'details', 'embed', 'iframe', 'keygen', 'label', 'select', 'textarea'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this list be defined as a constant off nuget?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above...I don't think it's super useful to have it available. If we need it somewhere else we can move it to nuget then.

@scottbommarito
Copy link
Contributor Author

After discussing with @anangaur - remove "delete organization" link for organization owners, keep delete icon for admins

@scottbommarito
Copy link
Contributor Author

Waiting on #6266 to merge

@scottbommarito scottbommarito merged commit 7b7ed59 into dev Aug 8, 2018
@scottbommarito scottbommarito deleted the sb-accessibility branch August 8, 2018 16:38
@scottbommarito scottbommarito restored the sb-accessibility branch July 22, 2019 23:18
@scottbommarito scottbommarito deleted the sb-accessibility branch July 22, 2019 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants