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

VoiceOver unable to interact with buttons #8178

Closed
3 tasks done
zacwest opened this issue Jan 17, 2021 · 44 comments · Fixed by #11447
Closed
3 tasks done

VoiceOver unable to interact with buttons #8178

zacwest opened this issue Jan 17, 2021 · 44 comments · Fixed by #11447
Assignees
Labels
Accessibility Related to accessibility for people with disabilities Bug Current Bug in UI - Extra Attention

Comments

@zacwest
Copy link
Member

zacwest commented Jan 17, 2021

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

The problem

The hamburger/menu button has 2 major issues:

  1. It's read as "Button" - no label
  2. Activating it does not work

Expected behavior

With VoiceOver enabled, I can interact with the menu button.

Steps to reproduce

  1. Turn on VoiceOver: Settings, Accessibility, VoiceOver, enable.
  2. Navigate to the Menu button in the Home Assistant app or in Safari
  3. Note the label read: "Button"
  4. Double tap to activate the menu button
  5. Note the menu does not open

Environment

  • Home Assistant release with the issue: 2021.1.3
  • Last working Home Assistant release (if known): none known
  • Browser and browser version: iOS 14.3's Safari
  • Operating system: iOS 14.3

State of relevant entities

n/a

Problem-relevant frontend configuration

Occurs on a vanilla install.

Additional information

Message me up on Discord and I can walk you through testing VoiceOver in the iOS simulator or on a physical device.

@zacwest zacwest added the Bug Current Bug in UI - Extra Attention label Jan 17, 2021
@spacegaier
Copy link
Member

Not an Apple user, so I cannot test that directly. But I just checked the coding and the menu icon button gets a label set that ends up as the aria label:

<button class="mdc-icon-button" aria-label="Sidebar Toggle">

Do other buttons such as the back and next button work (e.g. moving a Lovelace view left or right)?

@spacegaier spacegaier added the Accessibility Related to accessibility for people with disabilities label Jan 17, 2021
@zacwest
Copy link
Member Author

zacwest commented Jan 17, 2021

There's a mix of buttons that work and those that do not.

Works:

  • Selecting between views in a particular dashboard
  • The right/left arrows to scroll the list of views

Does not work:

  • Menu button, ••• button
  • When the side bar is opened, individual sidebar buttons
  • Opening the 'more info' on a card
  • (many more)

The ones that do not work somewhat universally show highlighted state when interacted with (in fact, the sidebar looks like it changes the activated one visually but it does not do the action).

@spacegaier
Copy link
Member

To make sure we are talking about the same ones: Those do work (moving a view left or right)?

image

@zacwest
Copy link
Member Author

zacwest commented Jan 17, 2021

Oh, no, this one does work:
image

The left/right arrows in your screenshot do not show up as distinct buttons, they're part of the view itself. Activating it just goes to that one, and you can't move them.

@zacwest zacwest changed the title VoiceOver unable to interact with hamburger/menu button VoiceOver unable to interact with buttons Jan 17, 2021
@ThomDietrich
Copy link

Is anyone working on this? This current limitation is a significant show stopper to use Home Assistant for blind people.
Happy to help where possible, sadly I am neither a frontend developer nor an iPhone user...

@spacegaier
Copy link
Member

Given that no one is currently assigned to the issue here, probably not (unless someone is without mentioning it here).

@zacwest FYI: The entries in the sidebar are not buttons, but just links. They seem to be missing an aria-label, but they have already an aria-role assigned.

Also in the first post you mentioned the "hamburg menu" icon, but as I wrote that one does have a label. However, in your second post you then mentioned the 3 dot icon (e.g. to activate UI edit mode or go to the more-info). Did you mean that one also in the original post?
Either way, on my side (Firefox on Win 10) all of those elements do have aria-label set (running version 2021.3.3).

@zacwest
Copy link
Member Author

zacwest commented Mar 14, 2021

The main menu button doesn't read out as a label in VoiceOver. I'm guessing there's some disconnect between the aria labels and the UI elements themselves when it comes to Safari.

@zacwest
Copy link
Member Author

zacwest commented Mar 14, 2021

Since a video is worth a bajillion words, this is what VoiceOver reads out for the things in the header, at least.

RPReplay_Final1615764290.mov

The clicking noises that I do repeatedly are the "activate" action, which normally would perform the button or whatnot.

@bramkragten
Copy link
Member

You do get the ripple, so it does get something... Weird that some do, and some don't work, since they mostly all work the same 🤔

@zacwest
Copy link
Member Author

zacwest commented Mar 15, 2021

I think overall very few buttons work, but they all visually look like they are handling the action.

@zacwest
Copy link
Member Author

zacwest commented Mar 15, 2021

You can also reproduce this using the iOS simulator and Xcode's Accessibility Inspector. You can launch both in Xcode via Xcode > Open Developer Tool.

  1. Launch the iOS simulator, navigating to e.g. login or lovelace
  2. Launch the Accessibility Inspector
  3. Change the Inspector's target from your Mac to the simulator

image

4. Click the inspector button and then click e.g. the main menu button 5. Click the 'activate' button

image

Normally, this would e.g. perform the button, but this does not work.

@ThomDietrich
Copy link

ThomDietrich commented Apr 23, 2021

Hey all, is there any development here? It would be fantastic if this issue could be resolved quickly. It is literally the only thing stopping me from moving a completely working openHAB setup over to HA.

Home Assistant is at the moment effectively not usable by the visually impaired and blind community, which is especially sad as they are a niche but very important user group...

I apologize for not contributing to the ticket myself. I do not own an iPhone or have any relevant experience in iOS / web development. The only thing I can do is raise awareness for the importance of this ticket and offer testing support.

Thanks and all the best!

@bramkragten
Copy link
Member

@ThomDietrich this issue is specifically for iPhone/iPad, if you don't any of those devices, your issue is probably a different one?

Could you maybe create a separate issue with your problems and the devices/browsers/tools you use?

@ThomDietrich
Copy link

ThomDietrich commented Apr 24, 2021

Hey @bramkragten, sorry for the misunderstanding. For background see my related issues #8643 and home-assistant/iOS#1538

Long story short: My brother is blind and depends on his smart home daily. He uses his iPhone and the excellent VoiceOver functionality to interact with every app, just as any of us do. The Home Assistant app is currently inaccessible for VoiceOver users. That effectively blocks us from the planned transition to HA and hence why this issue is so severely important for me, him, and the visually impaired community which could otherwise consider the live-changing advantages of a smart home (exagerating a bit, or am I ☺️). Hope that was clearer

While I have you: There are a few minor additional issues with accessibility which I captured in home-assistant/iOS#1538 (the one here being the major blocking one). If Nabu Casa wants to address the topic of accessibility by the blind more strategically and eventually celebrate that as another achievement, I would be happy to connect you to a few visually impaired smart home users.

@ThomDietrich
Copy link

Hello @zacwest and @spacegaier, did you by any chance find the time to look deeper into this?
It would be amazing if you could share a few thoughts about this issue. Do you see any short-term workaround that could be applied?

@bramkragten does a Nabu Casa internal format exist to address this topic more strategically.

Thanks all!

@spacegaier
Copy link
Member

This PR of mine might be related since I want to ensure that all icon buttons (so buttons without any text) have a title assigned so that tooltips are shown. I will also try to test that with voice commands to ensure the aria labels gets properly set as well.

#9230

@ThomDietrich
Copy link

Great to see! Let us know what the test reveals :)

@ThomDietrich
Copy link

ThomDietrich commented May 31, 2021

@spacegaier one more thought. button titles and aria labels are among the common issues with accessibility but in the case of this ticket the buttons can not be "pressed", being the way bigger issue. The video posted by @zacwest demonstrates that quite nicely.

Based on your PR description it doesn't solve that...

@ThomDietrich
Copy link

Hey all, to keep this ticket alive...

By now we transitioned my brothers home to Home Assistant and we "hacked" everything so he is able to use his iPhone app to do the most important things. The app is still a pain to use with the screenreader.

@bramkragten did you by any chance mention the topic of "smart home for the visually impaired" in any internal discussion? I would be thankful to point me in the right direction to advocate for the topic.

@spacegaier @zacwest if you would be interested, I am willing to put a bounty on the resolution of this issue.

@bramkragten bramkragten self-assigned this Jul 8, 2021
@github-actions
Copy link

github-actions bot commented Oct 6, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 6, 2021
@zacwest
Copy link
Member Author

zacwest commented Oct 6, 2021

iOS 15 is a little nicer here - the button names are read.

However, you still cannot activate the buttons with voiceover - nothing happens.

@github-actions github-actions bot removed the stale label Oct 6, 2021
@spacegaier
Copy link
Member

I think I read somewhere that VoiceOver can only activate if the buttons have an aria-label. If that is actually true, then #9230 will help in many places.

@steverep
Copy link
Member

I agree this issue is a major one and has been since the launch of the iOS app. I'd like to try and debug this, but I cannot do it on my phone. Could a developer please respond and let me know if it is enough to examine the code on my desktop PC, or if the mobile view of buttons is altered significantly. If so, an explanation of how (and where in the code) would be super helpful.

@steverep
Copy link
Member

We know nearly all buttons cannot be pressed with VoiceOver in either browser or app. Can anyone verify whether or not buttons can be activated on Android with Talkback? I don't have a device readily setup for me to test.

@ThomDietrich
Copy link

ThomDietrich commented Dec 14, 2021

Hey @steverep triggered by the recent comments by @bartbunting and yourself, I reached out to some of the core team via Discord and we had a great video call last Thursday. I've now provided the guys with videos showing the biggest issues and @bramkragten is carrying this forward. I will leave further coordination to him but he mentioned that he is looking for test users, so stay tuned!! All the best, th

@spacegaier
Copy link
Member

I just randomly found this issue, which sounds similar but on Android: #10617

@steverep
Copy link
Member

I just randomly found this issue, which sounds similar but on Android: #10617

Yep, that's probably the same issue, but I'd leave both open and not assume one fix will close both. I also think I might have found the problem, but I need to figure out a way to test it on iOS.

@zacwest
Copy link
Member Author

zacwest commented Dec 15, 2021

If you have a Mac, you can use the simulator instructions in the iOS repo -- or run the simulator with the website -- a previous comment of mine in this thread includes how to use Accessibility Inspector with it. If you do not, push up a branch and I can test it.

@steverep
Copy link
Member

So after a lot of sniffing through the DOM and accessibility tree, my diagnosis for why most buttons can't be clicked with screen readers on mobile is that they are clicking a button that does absolutely nothing.

Take the biggest offending components: ha-icon-button and ha-fab. Both of these insert native <button> elements in their shadow trees, which is the keyboard focusable element. However, the button is not listening for clicks. So the mobile screen reader lands on it and does nothing.

Instead, both of these custom elements are listening for clicks outside their shadow boundaries and performing the actual actions, and they are not keyboard navigable which is a WCAG 2.1.1 failure.

Why these buttons work using desktop screen readers and not mobile is a bit of a mystery, except that in general desktop screen readers and accessibility APIs are much smarter at catching inaccessibility like this and working around it. Weirdly, on iOS at least, some buttons can actually be clicked by using a triple tap with VoiceOver, which simulates a "long press". I have no idea why this would work.

So I think the obvious solution is to remove those click events from the custom elements and pass them to the buttons inside their shadow trees. This would also be the cleanest solution and least confusing in the final markup.

If that were an insurmountable feat, I could probably rig up a much dirtier solution playing with lots of attributes, but I'd hide in shame afterwards.

Unfortunately, I don't have a Mac to test on iOS, and I haven't had the chance to setup a Firefox remote test on an Android, but I feel fairly confident that moving those click listeners would do the trick.

Note this should also fix #10617 for Android.

@steverep
Copy link
Member

I've been working on this bug for over a week and I need some help from some experienced HA developers please 😅 .

First, I now realize my last comment was a bit uninformed on the finer points of event bubbling and delegation. I'm mainly a scientific/engineering programmer who dabbles head first into web development, but I'm a fast learner 👨‍🎓 .

In any case, here's the important parts of what I've learned:

  1. A replica of the ha-icon-button component on CodePen works just fine with VoiceOver on iOS, which tells me there's nothing fundamentally wrong with the code (or CodePen is injecting something to fix the issue)
  2. Adding a simple click event listener directly to the <button> element also does nothing, which tells me the click event is either being interrupted immediately or never fired
  3. Upgrading to lit 2.1.1 makes no difference (current frontend is held at 2.0.2)

What I really need is for someone with both an iPhone and Mac to use the Accessibility Inspector. Go to any ha-icon-button component, and look at the data in the accessibility tree for it and all of its descendants. If you can dump that and attach it here it might be a big help. And also simulate a click with VoiceOver on the button to check for errors obviously.

Finally, any suggestions on other packages or HA code to investigate as potentially interfering here would be appreciated.

@bartbunting
Copy link

bartbunting commented Jan 21, 2022 via email

@ThomDietrich
Copy link

@bramkragten maybe you can help here?

@steverep
Copy link
Member

Bingo 🥳. I started tracing click events in the Firefox debugger on my desktop and noticed all of them were being run through a handler in a polymer module gestures.js. Snooping around there led me to an obscure and undocumented setting called cancelSyntheticClickEvents, which is true by default. Flipping it to false solves this issue. The handler is either ignorant of or misreading screen reader clicks and just killing the events before they go anywhere.

I'm working on a PR for the fix and also filing an issue with polymer.

@bartbunting
Copy link

bartbunting commented Jan 24, 2022 via email

@zacwest
Copy link
Member Author

zacwest commented Feb 1, 2022

I can confirm this resolves the vast majority of the button issues, thanks. There are still some issues with the sidebar and more info screens which I'll open another issue for.

@digitaldarragh
Copy link

@ThomDietrich mentioned before that this was a show stopper for him. I understand that some might exclusively use IOS. So I don't want this to seem to be down playing the importance of this. But I do want to acknowledge the great work that the front end developers of HomeAssistant as this is a really useable interface on Windows with Windows screen readers. I don't have a system that I can install pre-release software on at the moment unfortunately. But as soon as this is released, I will most definitly test.

I recorded a video this evening to show HomeAssistant developers how a blind screen reader user interacts with the HomeAssistant UI.
https://www.youtube.com/watch?v=8HIPYK6-Eq4

Please let me know if I can be of any assistance. I am a big fan of what this project does.

@steverep
Copy link
Member

steverep commented Feb 3, 2022

To all screen reader users,

Update now to 2022.2.0 to get this fix, but do not update to the 2022.2.1 or later release when it comes. The fix has already been reverted because of #11520, so the mobile apps will become unusable again.

@bramkragten please make sure a warning is also put in the release notes.

@bartbunting
Copy link

bartbunting commented Feb 3, 2022 via email

@bramkragten
Copy link
Member

#11693 will fix this again

@steverep
Copy link
Member

Upcoming version 2022.3 (now in beta) will have this fixed again as @bramkragten mentioned, so it'll be safe to upgrade.

Screen reader users following this will probably quickly notice issue #11502 when opening dialogs. See my comments for the work around and subscribe to that issue for updates.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2022
@steverep steverep moved this to Done in Accessibility Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility Related to accessibility for people with disabilities Bug Current Bug in UI - Extra Attention
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants