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: Safari focus when there are no draggables left #360

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

CefBoud
Copy link
Contributor

@CefBoud CefBoud commented Oct 18, 2023

Description

This PR addresses an accessibility issue that has been observed only with Safari when relying solely on the keyboard.

The problem boils down to losing focus after the last correct drop happens and there are no more draggable items left in the bank.

The focus is "trapped" within .close-feedback-popup-button which loses visibility after it's closed and the focusFirstDraggable , which is subsequently called, tries to shift focus to the first option, which happens to be an invisible item placeholder that is not focusable because it has no tabindex.

Clicking Tab, Shift+Tab, or ESC has no effect in Safari. With Chrome or Firefox, however, the focus is able to leave the hidden button and jump to the first Zone.

This PR adds a check to ensure the presence of draggable items and otherwise defaults focus to the first Zone in focusFirstDraggable.

Testing instructions

  1. Launch LMS & CMS in devstack.
  2. Connect to your CMS using Safari
  3. Create a drag-and-drop problem. There is no need to edit. The default one (triangle) will do.
  4. Try to solve the problem correctly using only the keyboard.
  5. After dropping the last item and closing the feedback popup, focus should be lost

Please check the following video. I increased the outlines' width for better clarity.

focus_bug_safari.mov

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U labels Oct 18, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 18, 2023

Thanks for the pull request, @CefBoud! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

1 similar comment
@openedx-webhooks
Copy link

Thanks for the pull request, @CefBoud! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@CefBoud CefBoud marked this pull request as draft October 18, 2023 15:36
@Agrendalath Agrendalath marked this pull request as ready for review October 19, 2023 13:41
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: tested the described scenario in Safari
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

@Agrendalath Agrendalath merged commit 376ec5c into openedx:master Oct 19, 2023
8 checks passed
@openedx-webhooks
Copy link

@CefBoud 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

1 similar comment
@openedx-webhooks
Copy link

@CefBoud 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@Agrendalath Agrendalath deleted the CefBoud/fix-safari-focus branch October 19, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants