Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Business Hours: toggle loses focus after hitting the space bar #11833

Open roccotripaldi opened 5 years ago

roccotripaldi commented 5 years ago

As reported by @eduardozulian

What I expected: to navigate using the tab key and quickly toggle between Open and Closed with my space bar

What happened instead: once I hit space, the toggle loses its focus and I’m not sure where am I anymore. I have to hit tab for the second time in order to see the focus on the toggle again.

https://cld.wthms.co/0kAy3w

simison commented 5 years ago

Does this seem like an issue in the core component rather than at our end?

I suppose it still is navigatable with Enter key?

To be resolved first if this toggle is redundant: https://github.com/Automattic/wp-calypso/issues/31183

scottsweb commented 4 years ago

The same component in the gutenberg sidebar does not demonstrate this same behaviour, so I think it might be our implementation of it. Just trying to understand why focus is lost.

scottsweb commented 4 years ago

It looks to be caused by a re-render. The toggle is part of the UI that get re-rendered between the two states.