microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

Disabled ToggleSwitch is actionable when AllowFocusWhenDisabled="True" #1081

Open allan-ok opened 5 years ago

allan-ok commented 5 years ago

Describe the bug Grayed-out(Disabled) ToggleSwitch is actionable by tabbing into it and pressing space bar when AllowFocusWhenDisabled="True". Clicking and tapping still do not trigger a change in the toggle switch as expected.

Steps to reproduce the bug -Have a ToggleSwitch, with properties 'IsEnabled' set to false and 'AllowFocusWhenDisabled' set to true. -Tab into the ToggleSwitchand hit spacebar

Expected behavior -ToggleSwitch should not change

Windows 10 version Saw the problem?
Insider Build (18939) < Yes >
Device form factor Saw the problem?
Desktop < Yes >
jevansaks commented 5 years ago

My guess is that AllowFocusWhenDisabled was added after many of our controls were implemented. @Austin-Lamb perhaps AllowFocusWhenDisabled should block keyboard input to the controls when focus is disabled?

Austin-Lamb commented 5 years ago

@marb2000 - assigning to you for now. I think Jevan's suggestion is interesting, but may have unintended consequences we should think through. This feels like a feature request, so tagging that way.

@jevansaks - Note this could be fixed in ToggleSwitch more immediately if this feature request for AllowFocusWhenDisabled moves too slowly.