@tilleryd @kaitmore Take a look at this when you get a chance.
This isn't a particularly interesting use case for React-Aria etc., it's just a simple component to start with.
Features:
Normalized behavior and control for the ToggleSwitch across device interaction modes (touch vs. mouse).
Improved checks for accessibility issues (such as missing label)
Notes:
Normal use of the ToggleSwitch should seem exactly the same as before
Avoid using native :hover, :active, etc. psuedo-states to style ToggleSwitch elements. All controlled by classes now, as a result of the behavioral normalization.
We'll have to refactor the global form interaction styles to accomodate this, but the result should be much cleaner and comprehensible
Click-like and Tap-like events are abstracted into "Press" event
Hover-like events are available only during mouse interaction, and won't fire when using touch
Future improvements could include breaking down the component into its subcomponents, so users can manually wrap ToggleSwitches with appropriate labels, but that's out of scope for this effort.
@tilleryd @kaitmore Take a look at this when you get a chance.
This isn't a particularly interesting use case for React-Aria etc., it's just a simple component to start with.
Features:
Notes:
Future improvements could include breaking down the component into its subcomponents, so users can manually wrap ToggleSwitches with appropriate labels, but that's out of scope for this effort.