WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
RangeSelector does not announce value changes when changing thumb position with arrow keys
Describe the bug
A clear and concise description of what the bug is.
When using RangeSelector with narrator, pressing left/right arrow key changes the thumb value, however users are not being updated on the new value of the thumb.
- [ ] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
- [x] Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)
Steps to reproduce the behavior:
- Start Narrator (Ctrl+Win+Enter)
- Open RangeSelector page
- Focus one of the RangeSelector thumbs
- Move thumb with arrow keys, notice that narrator does not announce changes
Expected behavior
A clear and concise description of what you expected to happen. Narrator should announce changes, ideally also announce upper and lower limit (RangeValuePattern)
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
NuGet Package(s):
Package Version(s):
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [x] Insider Build (build number: 20236)
App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [] Insider Build (xxxxx)
Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ ] 2017 (version: )
- [ ] 2019 (version: )
- [ ] 2019 Preview (version: )
Additional context
Add any other context about the problem here. The UIA experience of RangeSelector is not ideal, maybe providing the RangeValuePattern for both thumbs improves this. Also more fitting UIA names for the thumbs could be chosen.
Another thing I noticed is that you can move the max-thumb with the minthumb if you keep pressing right-key. Similiarly, focusing the max-thumb and pressing down left-key eventually moves the min-thumb. Moving the thumbs with the mouse does not exhibit that behavior. Is that arrowkey behavior by design?
Hello chingucoding, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
So there seems to be a small issue with providing a good way to use this control through UIA. There doesn't seem to be a pattern that does exactly what this control does, the closest would be RangeValue, but that isn't really a good choice here.
So raising a property changed on the RangeSelector control is a bit problematic (what property did change?). Another option would be to raise property change on the thumb elements. However this is where we encounter the next problem, Thumb is unsealed, so we can't simple inherit it to provide a custom AutomationPeer. So we would need to implement our own control to be able to provide a custom AutomationPeer that would allow us to notify narrator of a value change.
Can verify that this bug is reproducible in the sample app. It's not announcing thumb values at all, only "Max thumb / thumb" and "Min thumb / thumb".
Maybe we're looking at this the wrong way.
RangeSelector is just 2 sliders (min and max value) bundled into 1 control, so rather than trying to use a single IRangeValueProvider
on the entire control, perhaps we implement a RangeBaseAutomationPeer
on each individual thumb and treat them as separate sliders.