Hacker News new | ask | show | jobs
by abtinf 584 days ago
> 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.

1 comments

> 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/

> 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?

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.