←back to thread

293 points ulrischa | 2 comments | | HN request time: 0.416s | source
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 #
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 #
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 #
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 #
1. j16sdiz ◴[] No.42179471[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 #
2. hombre_fatal ◴[] No.42184706[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.