Skip to content

Help Modal - Accessibility Fixes - #902

Merged
jtauber merged 6 commits into
openedx:masterfrom
antoviaque:accessibility
Sep 13, 2013
Merged

Help Modal - Accessibility Fixes#902
jtauber merged 6 commits into
openedx:masterfrom
antoviaque:accessibility

Conversation

@antoviaque

Copy link
Copy Markdown
Contributor

Fixes for LMS-602, LMS-584, LMS-582, LMS-581. This is a set of accessibility fixes, mainly for the help modal.

Cf discussion below for details.

@talbs @jtauber @adampalay

Also adding the email description to the login page and applying the
same aria attribute to the correspondin input on that page.

From LMS-602:

> There is additional explanatory text, marked up in a span element after
> the email input. The input elements should be explicitly associated with
> this additional text using the aria-describedby attribute. This will
> require an ID to be assigned to the span element.
> To make this change explicit to assistive technology, focus should be
> moved programmatically to this div after it has been made visible. To
> allow the div to be focused via scripting (without adding it to the
> regular focus order that keyboard users cycle through), a tabindex=”-1”
> should be added.

> In addition, the invalid fields should be given a an
> aria-invalid="true" attribute.
Added a 'aria-hidden="true"' attribute to the modal initially, then
toggle the value of that attribute to "false" when the modal is shown.
Also remove the attribute when the modal is closed, whether it's through
a click on the close button or on the overlay.
The close button for the modal dialog was marked up as a paragraph,
containing a graphical text character, inside two div elements, with an
associated click event. This made the button unusable for keyboard
users.

Replaced <divs> with a link element (<a role="button"), adapted the CSS
accordingly, and updated the existing <a> modal close buttons.
Modal dialogs should manage keyboard focus, ensuring that users can't
tab out of the modal dialog and back into the page itself (effectively
moving “behind” the dimmed modal). On the last focusable element of the
dialog, return focus back to the first focusable element.

Also move the close button to the start of the dialog's section, making
it the first focusable URL, to ensure focus matches the visual
representation of the dialog.
Users should be able to close the modal with the "escape" key.
@antoviaque

Copy link
Copy Markdown
Contributor Author

On Mon, Sep 9, 2013, at 8:26, Brian Talbot wrote:

  • LMS-602: Would you mind applying this same recommendation to all fields
    in this form that have an accompanying element? Also,
    when adding id attributes to each element, can you follow the
    convention set within this issues description ("id of input/formfield" +
    "-tip" - e.g. id="name-tip" for the full name field). Also, it looks like
    we've removed the tip for the email address field noted in the issue's
    description. Would you mind adding that back to the login view's template
    (lms/templates/login)?

This was about the forgot password form I think (lms/templates/forgot_password_modal.html), where the tip for the email address is still present. It makes sense to have this tip on the login too though, so I've added it to the login view, and applied the same recommendation to the new - is that good?

The only other <span class="tip"> I've seen is the "Forgot password?" link on the login page -- I didn't add the aria-describedby to that one, since that doesn't exactly describe the password field - is this ok?

  • LMS-585: I believe this issue has already been corrected. The template
    file that contains this HTML looks to already have a fix in place (made
    by these two commits -
    edx@214a814
    and
    edx@7452381).
    I don't think there's anything for you to follow-up with on that - I'd
    mark it as already resolved, please.

Sounds good, I've left that one alone.

  • LMS-582: I'd prefer that the close modal control be marked up with a
    link element ().

Done. I also assume that you want to use the "title" attribute instead of the hidden-accessible class trick? I saw the <a title="Close"> being used already, and it seemed cleaner, so I went for the first option, but let me know.

I also wasn't sure if you wanted me to replace the class name with action action-modal-close. Since the class modal-close was already referenced from several places, I acted conservatively and kept the existing class name, but let me know.

  • LMS-584: I'd also like to toggle another HTML attribute along with the
    "tabindex" one recommended. Could you please 1) add a
    'aria-hidden="true"' attribute to the modal to begin with and 2) then
    toggle the value of that attribute to "false" when the modal is shown?

Done. I'm also removing the attribute when the modal is closed, whether it's through a click on the close button or on the overlay.

And also done LMS-581. I only applied it to the help dialog, as I think this bug was specifically about this one.

Thanks again for the help , its very much appreciated. Please let me know
if you have any questions or concerns.

Btw I didn't find tests for the help modal, so I didn't add/update tests with the changes I've made -- do you know if there are tests for this feature somewhere?

Also, do you know why is the code for the help modal inline in the HTML, rather than part of the static assets?

@jkarni

jkarni commented Sep 10, 2013

Copy link
Copy Markdown

awesome stuff!

@adampalay

Copy link
Copy Markdown
Contributor

This is great, thanks
👍

@talbs

talbs commented Sep 13, 2013

Copy link
Copy Markdown
Contributor

@antoviaque, thanks for all of this great work. I took a spin through and things seem to be in good order.

To answer a few of your questions:

Btw I didn't find tests for the help modal, so I didn't add/update tests with the changes I've made -- do you know if there are tests for this feature somewhere?

I don't think we have any tests written for the help modal, but that is less of my expertise honestly. @jzoldak, are there any tests written/testing dependencies on the help modal at all?

Also, do you know why is the code for the help modal inline in the HTML, rather than part of the static assets?

Good question, honestly it may have come down to speed and time constraints when initially implementing it. Abstracting the JS into its own method may be good things to do in the near future. Thanks for the heads up.

This looks good from my perspective. 👍 Thanks again!
@jtauber, are there any other steps needed before we merge/close on this good work?

@antoviaque

Copy link
Copy Markdown
Contributor Author

@talbs @jkarni @adampalay Thanks for the kind words, I'm glad this can be helpful. And thanks to you in the first place, for the great work on edX. It's a pleasure to work with the project's code!

@wedaly

wedaly commented Sep 13, 2013

Copy link
Copy Markdown
Contributor

@talbs We have acceptance-level tests for the help modal. I ran the LMS acceptance tests on this branch, and everything looks good.

@talbs

talbs commented Sep 13, 2013

Copy link
Copy Markdown
Contributor

@wedaly, thx for checking and that's great news. This is ready to bring to "mergetown" from my perspective.

jtauber added a commit that referenced this pull request Sep 13, 2013
Help Modal - Accessibility Fixes
@jtauber
jtauber merged commit c6dfd97 into openedx:master Sep 13, 2013
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
…urn-only-username

Return only username on OpenID provider requests.
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Aug 9, 2016
* Merge pull request openedx#937 from nttks/gacco/cypress.biz-2nd (openedx#943)

* Merge pull request openedx#937 from nttks/gacco/cypress.biz-2nd

gacco/cypress.biz 2nd
(cherry picked from commit 4bc3bc2)

Conflicts:
	biz/djangoapps/ga_achievement/management/commands/tests/test_update_biz_score_status.py
	lms/djangoapps/ccx/tests/test_field_override_performance.py
	lms/djangoapps/instructor/tests/test_api.py
	lms/envs/test.py
	setup.py

* Merge pull request openedx#941 from kawaguchi-ks/develop/cypress/biz-fix-timezone-problem

Fix timezone problem on boundary test.
(cherry picked from commit 20e1b0c)

* Fix transaction, autocommit(commit_on_success) -> atomic.

* Define class Meta.

* Change AUTHENTICATION_BACKENDS for disable RateLimitBackend within lo… (openedx#902)

* Change AUTHENTICATION_BACKENDS for disable RateLimitBackend within login authentication(openedx#540) (openedx#883)
(cherry picked from commit 1e8b68a)

Conflicts:
	cms/djangoapps/course_creators/tests/test_admin.py

* Fix test, "RedirectCycleError: Redirect loop detected".
ericfab179 pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 14, 2018
caesar2164 pushed a commit to caesar2164/edx-platform that referenced this pull request Sep 17, 2019
Commits:
  Add marketing opt-in checkbox to registration form
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
We missed a copy edit from the previous PR made for this ticket. Also
changing the id to something more relevant to the message.
DanielVZ96 pushed a commit to open-craft/openedx-platform that referenced this pull request Jan 31, 2024
…hn_mfe

fix: don't enable Authn MFE by default
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.

6 participants