Use default SmallChange value for WinUI slider #14912
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Use default SmallChange value for WinUI slider.
Context:
Currently, we are calculating a value for SmallChange to be 0.1% at all times. This makes the slider experience pretty inaccessible, via touch/tap (with Narrator, on touch devices, double tap increments and triple tap decrements) and keyboard (using left/right arrow keys, with or without Narrator). This is inaccessible because it requires 1000 strokes to move the thumb from one end of the slider to the other.
On WinUI, the default values make slider increment by just 1 value (which is a different % based on the min and max values; i.e. 100% for default slider 0 to 1; 10% for a slider with min 5 to max 15) via mouse, touch, and keyboard. As long as a StepFrequency or SmallChange is NOT set and/or are the same value, the increment is consistent via both mouse/touch and keyboard. While this would be an ideal condition to have, it will lead to either: (a) touch and keyboard navigation inaccessible, or (b) mouse dragging slider smoothly in-between values impossible (thumb will snap to increment values).
Since we don't currently have a Slider property in .NET MAUI for setting the increment, we need to ensure that the default increment that we offer is still sensible and accessible. In investigating the behavior on other platforms, I discovered that unlike on WinUI, the mouse drag behavior is actually NOT consistent with the touch and keyboard behaviors for slide ron any of the other platforms.
So, at least for now, it makes sense to stick to the default value for SmallChange. (We can keep the 0.001 increment for StepFrequency for now, as that is what allows for the smooth mouse click/drag sliding of the slider).
(no crashing here on the min=max=value edge case either, as that was happening due to the increment calculation previously being based on min and max values)
Issues Fixed
Fixes #14748