Most active commenters
  • O-stevns(4)

←back to thread

293 points ulrischa | 23 comments | | HN request time: 0.527s | source | bottom
Show context
nozzlegear ◴[] No.42174177[source]
For anyone who didn't click through to the WebKit bug report the author submitted, a WebKit dev asked him to clarify why the BBC finds it beneficial to be able to detect that the event was sent from a keyboard. This is the author's response:

> Ironically, I want interoperability on this to help with use cases relating to accessibility.

> I work at the BBC and, on our UK website, our navigation bar menu button behaves slightly differently depending on if it is opened with a pointer or keyboard. The click event will always open the menu, but:

> - when opening with a pointer, the focus moves to the menu container.

> - when opening with a keyboard, there is no animation to open the menu and the focus moves to the first link in the menu.

> Often when opening a menu, we don't want a slightly different behaviour around focus and animations depending on if the user 'clicks' with a pointer or keyboard.

> The 'click' event is great when creating user experiences for keyboard users because it is device independent. On keyboards, it is only invoked by Space or Enter key presses. If we were to use the keydown event, we would have to check whether only the the Space or Enter keys were pressed.

Source: https://bugs.webkit.org/show_bug.cgi?id=281430

replies(5): >>42174432 #>>42174435 #>>42174511 #>>42174692 #>>42175176 #
1. O-stevns ◴[] No.42174511[source]
Seems like a non bug to me.

The first mistake the developer made, was that he wanted to create a different user experience between keyboard and mouse. Stick to what you get by default and design your components so they work for both usecases. Don't try to be smart when it comes to accessibility.

What he ended up doing is what I would have considered a hack. A solution that inevitably breaks or has side effects.

The reason there rarely are good handles to do things differently in accessibility context, is because it's not something that's meant to be handled differently.

replies(5): >>42174804 #>>42174993 #>>42175139 #>>42176540 #>>42185087 #
2. f1shy ◴[] No.42174804[source]
> Don't try to be smart when it comes to accessibility.

“Don't try to be smart” alone is good advice in general and everywhere. Also in UI “don’t try to be original”

replies(2): >>42174895 #>>42177518 #
3. afandian ◴[] No.42174895[source]
The BBC site has a "search box" that's actually a button that brings up the real search box. Always feels confusing. At least it's consistent across News / Sounds / iPlayer.
replies(1): >>42180379 #
4. willwade ◴[] No.42174993[source]
See I work in accessibility. Like I provide and create solutions direct to end users with complex needs. Not regular web accessibility. I get the view of this. It’s the same idea of universal access. But actually I don’t fully agree. Yes. If you can stick to this principle - and do try / but I promise you edge cases - which in itself is what accessibility users are all about - cause headaches. At some level you have to do custom stuff. It’s the best way. Take for example switch users. Yes. If your ui is tab able - great. But what if you need your items scannable in frequency order. Your tab index needs to change to meet the end users needs. Or eye gaze users. The accuracy level changes. Add in cognitive issues. You can’t just make a one size fits all interface. At some stage you need to significantly customize it. You can’t rely on a user just learning a complex system level interaction technique- if they can’t do that you have to customise on an individual level.
replies(3): >>42175182 #>>42175209 #>>42175449 #
5. joshtumath ◴[] No.42175139[source]
I am the author.

> The first mistake the developer made, was that he wanted to create a different user experience between keyboard and mouse. Stick to what you get by default and design your components so they work for both usecases.

We have. The behaviour is mostly the same whether you're using the keyboard or a pointer (mouse/touch/pen). The only difference is that, for keyboard users, we want to turn off the animation and move the focus to the first link in the menu instead of focussing on the menu's parent <ul>.

The problem was that, as various devs have iterated on the menu over the years, it's broken the fallback behaviour. For my colleague on the funny multi-monitor set up, it should have fallen back to the keyboard no-animation behaviour with no real major difference to the UX, but instead it fell back to the no-JS experience.

So yes, generally don't try to be smart with accessibility, avoid ARIA attributes except where necessary, etc, but click events are the universal input event and work on any kind of input device and have perfect browser support. It's far better for accessibility using them instead of a mix of keydown and mousedown or pointerdown, and potentially missing other kinds of input events.

As I stated in another comment, if it was a scenario where there needs to be a major difference in behaviour between keyboard and pointers, then I would rather use separate keydown and pointerdown events.

replies(2): >>42175748 #>>42179411 #
6. joshtumath ◴[] No.42175182[source]
Well said! It certainly applies to web development as well. Sadly, sometimes more complex solutions are needed - especially when based on user research.
7. hinkley ◴[] No.42175209[source]
Also note, it’s been about 10-15 years since the rules changed and if you want to work on a government contract, accessibility is mandatory.
8. O-stevns ◴[] No.42175449[source]
Of course there are edge cases, I work with accessibility too, for an app in the public sector where WCAG rules are no joke, so I know this as well but even so, we don't build custom accessibility UI for our users. We (try to) build the UI with accessibility in mind so it's scalable, can be used and navigate properly by voice over and keyboard.

On mobile it's not perfect either but in general you do have features to change stuff like. focus, grouping of elements, how the keyboard navigate the view stack, how to access a button through custom actions and like you mention, change the tab index programmatically.

Even so, not everything can be fixed or handled through standard accessibility means and as such hacks will inevitably make it into the products.

I get what you're saying but I still think that making things accessible and designing with common accessibility in mind should be default and as such it has to be thought about when designing and developing from the get go. Having to create custom interfaces to fulfill a specific need might be a good fit for some things but not when developing apps and websites unless you're targeting that user-group specifically.

9. O-stevns ◴[] No.42175748[source]
The _mostly_ same behavior is what caused the problem though :P I'm curious, did these solutions come to pass because you had to make adjustments based on actual user feedback or was it just a developer trying to think ahead? I'm questioning whether forcing the user to tab to get to the menu item is a hindrance at all or whether the animation was a problem.

Maybe the former could have been solved using ARIA tags or maybe it would require bigger changes to the component itself. Accessibility is a roller-coaster for all these reasons alone.

10. that_guy_iain ◴[] No.42176540[source]
> The first mistake the developer made, was that he wanted to create a different user experience between keyboard and mouse.

No, they wanted to make them the same. It's just to give a blind person the same experience as a seeing person requires different things because they operate differently for obvious reasons. For example, a blind person can't see when an animation has finished. They expect that menu to be available once they've triggered it. However, seeing people see the dropdown appearing and then go to use it once it's ready.

> Don't try to be smart when it comes to accessibility.

In all seriousness, considering the state of accessibility as is, I think going outside the box isn't trying to be smart. It's actually being smart. The BBC frontend team is probably at the forefront of making high-traffic websites extremely usable.

replies(2): >>42177333 #>>42180852 #
11. pwg ◴[] No.42177333[source]
> For example, a blind person can't see when an animation has finished. They expect that menu to be available once they've triggered it. However, seeing people see the dropdown appearing and then go to use it once it's ready.

For my two-cents, the BBC was simply trying too much to be "cutesy". Don't animate anything, because the silly animation on mouse click simply makes the website feel slower overall. Just open the menu as fast as the user's browser will open it.

replies(2): >>42177751 #>>42179471 #
12. josephg ◴[] No.42177518[source]
I prefer the line: “make it as simple as possible, but no simpler”

Sometimes complexity is simply the right tool for the job. Complexity is essential and valuable in all sorts of places - like fuzzers, LLMs, compilers, rendering engines, kernel schedulers and so on. But projects only have so much complexity budget to spend. I think I've spent my whole career trying to figure out how to spend complexity wisely. And I could spend decades more on it.

13. unclad5968 ◴[] No.42177751{3}[source]
That wouldn't change anything. They want the first element of the menu to be focused when "clicked" from a keyboard but not from a mouse. The animation doesn't affect that.
14. abtinf ◴[] No.42179411[source]
> we want to turn off the animation and move the focus to the first link in the menu instead of focussing on the menu's parent

Why not just always turn off the animations? Why not just always move the focus to the link?

What is the benefit of the animation to the user? What is the benefit of focusing on the menu’s parent to the user?

One rule of thumb with accessibility is that accessible products are usually better for everyone.

replies(1): >>42179604 #
15. j16sdiz ◴[] No.42179471{3}[source]
> Don't animate anything

Animation helps to correlate screen elements. Without animation it actually takes longer to establish the mental relationship between the action and the result.

replies(1): >>42184706 #
16. yreg ◴[] No.42179604{3}[source]
> What is the benefit of the animation to the user?

Animations enhance experience by drawing attention to state changes and providing intuitive feedback to user actions.

If you don't find them engaging or useful, that's fine - and you can set prefers-reduced-motion to true on your client - , but many people do.

> What is the benefit of focusing on the menu’s parent to the user?

The first item was not interacted with nor navigated to, therefore it shouldn't be focused under normal circumstances. It would be unexpected behavior.

Focusing the first item in keyboard interactions is an accessibility hack recommended by W3C:

https://www.w3.org/WAI/ARIA/apg/patterns/menubar/

replies(1): >>42180530 #
17. eCa ◴[] No.42180379{3}[source]
This is becoming more and more common. Can’t say I’m a fan either.
18. deathanatos ◴[] No.42180530{4}[source]
> Animations enhance experience by drawing attention to state changes and providing intuitive feedback to user actions.

> If you don't find them engaging or useful, that's fine - and you can set prefers-reduced-motion to true on your client - , but many people do.

The question here is not "does an animation have worth", but how is that worth tied to whether an onclick event originated from the mouse or the keyboard? Your reasoning applies equally to both, and thus leaves us still confused: why are we varying the animation by input device?

replies(1): >>42180669 #
19. yreg ◴[] No.42180669{5}[source]
The question was "Why not just always turn off the animations?"

---

> why are we varying the animation by input device?

Another user explains it here: https://news.ycombinator.com/item?id=42176540

I don't actually agree, I think you can keep the animation and still make the content available immediately for screen readers. (And of course, keyboard navigation is not just for screen reader users!) Maybe someone else knows of some issue I don't.

20. O-stevns ◴[] No.42180852[source]
> a blind person can't see when an animation has finished. They expect that menu to be available once they've triggered it. However, seeing people see the dropdown appearing and then go to use it once it's ready.

A blind person can and should get cues from their assistive technologies that an item is is being loaded and is shown, either using announcements or aria tags that provide this information to the user.

While its fine to expect that something is available immediately, that's rarely a realistic expectation, whether you're blind or not.

replies(1): >>42181109 #
21. that_guy_iain ◴[] No.42181109{3}[source]
If you remove the can, I would agree.
22. hombre_fatal ◴[] No.42184706{4}[source]
We as developers think we like zero animation. Probably not least because animation is harder for us to implement than just view(state).

But it's very easy to create cases where the UX sucks because things happen instantly especially as inherent complexity of the app increases.

23. cryptonector ◴[] No.42185087[source]
I think there is no browser bug here, though using negative screen coordinates is probably going to be surprising to a lot of folks.

However, the BBC's intent seems quite sound to me from an a11y point of view, and their commitment to a11y is commendable. Though it's likely that for some browsers their attempts at defining their own a11y experience will result in a bad UX anyways.