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

Opening button doesn't get focus when modal closes in iOS with VoiceOver #100

Open
backwardok opened this issue Jan 10, 2018 · 3 comments
Open
Assignees
Labels
Milestone

Comments

@backwardok
Copy link

Issue

Steps to reproduce:

  1. Turn on VO on an iOS device (doesn't seem to matter what version, even the latest version has this issue)
  2. Go to the main demo page and navigate to the Inline Attribute Configuration example
  3. Click the Show Modaal button to open the modal
  4. Tap the screen to get focus to go to the modal (there's a separate issue where the modal doesn't get focus)
  5. Navigate via swiping to the close button of the modal (at the end)
  6. Activate the close button

What's expected:
VO focus moves back to the Show Modaal button

What happens:
VO focus is at the end of the page (where the modal previously existed)

What's going on

MDN's activeElement documentation mentions that on a Mac, this may only work with text inputs. I found that this is only true on iOS and not on the Mac. If you are on a button that's focused and you query for activeElement, it doesn't return anything.

@danhumaan
Copy link
Collaborator

As commented in #99, we seem to be running into is a random result in the 'return to last focus state' where VoiceOver, if it can't find/remember the state for whatever reason, will default to a focusable element nearest the last press being the close button of the modal.

What JavaScript we've tested so far doesn't seem to have much difference as VoiceOver will make its own decisions on where to go and ignore what we're asking it to do.

In short, needs more work but the issue is understood. Contribution on this from anyone is very welcome.

@danhumaan danhumaan added the bug label Nov 6, 2018
@danhumaan danhumaan added this to the v0.4.5 milestone Nov 6, 2018
@danhumaan danhumaan self-assigned this Nov 6, 2018
@backwardok
Copy link
Author

For this one, you likely need to pass in a reference to the opening element (or actually keep track of what opened it when it triggers the modal) to explicitly focus that element (instead of activeElement) since iOS Safari doesn't seem to track <button>s as active.

@danhumaan
Copy link
Collaborator

danhumaan commented Nov 7, 2018

Thanks @backwardok - we already do keep track of the original element at the point the modal is triggered to open, only it hasn't been used by VoiceOver correctly or as expected. The replies to #99 have given us a good base and reference point to work from, so we expect to have updates to this task as well rolled into that. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants