skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

Switch cannot be selected via keyboard

Open ouvreboite opened this issue 6 months ago • 1 comments

Current Behavior

The switch component (here or even on the homepage) cannot be selected or toggle using the keyboard (Tab), which means it's not accessible.

Image

Expected Behavior

I should be selectable/toggable via the keyboard.

Steps To Reproduce

No response

Link to Reproduction / Stackblitz

No response

Environment Information

No response

More Information

No response

ouvreboite avatar Jun 02 '25 15:06 ouvreboite

Just to clarify, the issue is the Switch component itself doesn't reflect the selection state visually.

If you select near the selection, press tab, then spacebar, the switch will toggle.

The reason for this is Zag uses custom CSS selector statements and custom styles. Where as Skeleton tends to lean into the default selection state in the case of native buttons, ect to avoid this scenario. So these are a bit at odds. https://zagjs.com/components/svelte/switch#styling-guide

That said, I'd like us to resolve this, but it may require some cooperation with Zag to allow utility classes to be used, as per the Skeleton norm. But it's part of the items we're reviewing as part of the larger component pass for v4.0:

  • https://github.com/skeletonlabs/skeleton/issues/3463
  • https://github.com/skeletonlabs/skeleton/pull/3491

We may even group this item into that as relevant.

FYI @Hugos68

endigo9740 avatar Jun 02 '25 15:06 endigo9740

This will be fixed in V4

Hugos68 avatar Sep 29 '25 13:09 Hugos68

Solved in Skeleton v4 RC - try it here: https://github.com/skeletonlabs/skeleton/discussions/3844

endigo9740 avatar Oct 01 '25 23:10 endigo9740