Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrator does not announce updated value of NumberBox when we change the value with increase/decrease button. #1882

Closed
YuliKl opened this issue Jan 24, 2020 · 12 comments
Assignees
Labels
A11yMediumImpact A11ySev2 Non-blocking for core user tasks or blocking for non-core user tasks. A11yWCAG accessibility Narrator, keyboarding, UIA, etc area-NumberBox NumberBox Control team-Controls Issue for the Controls team

Comments

@YuliKl
Copy link

YuliKl commented Jan 24, 2020

Describe the bug

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Turn on Narrator
  2. Launch XAML Controls Gallery.
  3. Activate NumberBox from "What's New" page.
  4. Navigate to number box placed under header A number box with Spin button.
  5. Ensure SpinButtonPlacement is set to Compact.
  6. Now try to increase/decrease the value of number box by activating increase/decrease button only and observe if the updated value is announced to user.

Expected behavior

Narrator should announce updated value of number box.

Screenshots

image

Version Info

Xaml Controls Gallery version 1.2.12.0

NuGet package version:

Additional context

Feels related to #1879

Copied from internal bug

@YuliKl YuliKl added the area-NumberBox NumberBox Control label Jan 24, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jan 24, 2020
@kmahone kmahone added team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 28, 2020
@SavoySchuler SavoySchuler self-assigned this Jan 28, 2020
@chrisglein chrisglein added the accessibility Narrator, keyboarding, UIA, etc label Jan 30, 2020
@marcelwgn
Copy link
Collaborator

It seems like that the issue is caused by the following line:

textBox.Select(static_cast<int32_t>(newText.size()), 0);

One possible workaround (albeit not the perfect fix) is to select the complete text, that is change the line to:

textBox.Select(0, static_cast<int32_t>(newText.size())); 

which would result in the text being announced as "[value] selected" where value is the current value of the NumberBox, e.g. 12.

Would that be an acceptable fix?

@marcelwgn
Copy link
Collaborator

@ranjeshj @YuliKl @SavoySchuler Your thoughts?

@Felix-Dev
Copy link
Contributor

@chingucoding As you said it wouldn't be a pefect fix. In fact I'm not sure if I'd be too much of a fan of this workaround, as it would constantly select/keep the NumberBox value selected when clicking the up/down buttons. I would like to have a experience where I can increase/decrease a value in larger steps and rapidly modify the last digit(s) if required. Granted, with the value selected this would just be one more click more...but it is one additional click. Furthermore, this would impact every user in their NumberBox experience, even if not by much, no matter if they use the Narrator or not.

Is there no other way to to announce the updated value in Narrator?

@marcelwgn
Copy link
Collaborator

The fix I mentioned earlier in this thread wouldn't change that behavior. We are already changing the caret everytime we change the value. What my change would do is just change HOW we change the caret. Currrently iirc we set the caret at the end of the number when the value changes. For some reason Narrator doesn't deal with that that well, however if we select the text, that Narrator would announce the new value.

@Felix-Dev
Copy link
Contributor

Felix-Dev commented Jun 30, 2020

@chingucoding As you said correctly, currently using the up and down spin buttons, we set the caret to the end of the of value while not selecting the value. That way, I can easily press backspace keybord key and modify the last digit if required (in case the increase/decrease steps used are larger than "1"). With your proposed workaround, that wouldn't be possible any longer. Each time I press the up/down spin buttons, the value would be selected no matter what. So instead of just having to press backspace key, I now need to press an additional key first to unselect the value. This is the change in behavior I referred to in the post above which would affect the UX of everyone using the NumberBox - no matter if they use narrator or not.

@marcelwgn
Copy link
Collaborator

Oh sorry totally missread your comment. My apologizes.

The problem I see is the following: When we change the value through the decrease/increase buttons, we raise the ValuChanged event on the NumberBoxAutomationPeer. However Narrator seems to ignore that. Instead of announcing "[value] updated" or something like that, it just announces "end of line" as we are also setting the caret to the end of line. It doesn't matter whether we raise the ValueChanged UIA event before or after we change the caret position.

Through the "hack" proposed above, essentially we would get the narrator to announce the not announce "end of line" but rather the value.

@Felix-Dev
Copy link
Contributor

Yeah, "end of line" is not acceptable. Huh...I really do hope there's a better way here to fix this issue.

@marcelwgn
Copy link
Collaborator

Yes I hope so too, but narrator seems a bit "picky" given that #2692 also is currently paused as narrator doesn't seem to care about a selection change either. Interestingly, some properties work just fine while others don't for some reason.

@ranjeshj
Copy link
Contributor

ranjeshj commented Jul 2, 2020

Are you saying that changing the value and raising value changed automation event is somehow making Narrator read the wrong value ? I would have expected Narrator to get the new value through the automation peer and announce that. Is "end of line" coming from the TextBox's automation peer ?

@marcelwgn
Copy link
Collaborator

marcelwgn commented Jul 2, 2020

It seems that changing the caret position happens directly after we raise ValueChanged resulting in narrator skipping announcing the new value and jumps to announcing "end of line".

Unfortunately, raising "ValueChanged" after we set the caret also doesn't seem to work here for some reason.

@ranjeshj
Copy link
Contributor

ranjeshj commented Jul 7, 2020

This is likely an issue with how Narrator is reacting to value changes. This is tracked by an internal bug (listed in the issue description above).

@YuliKl YuliKl added the A11yMAS label Oct 30, 2020
@chigy chigy added the A11ySev2 Non-blocking for core user tasks or blocking for non-core user tasks. label Apr 6, 2021
@karkarl
Copy link
Contributor

karkarl commented Sep 21, 2021

Does not repro (updated values are read properly by narrator) so closing.

@karkarl karkarl closed this as completed Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11yMediumImpact A11ySev2 Non-blocking for core user tasks or blocking for non-core user tasks. A11yWCAG accessibility Narrator, keyboarding, UIA, etc area-NumberBox NumberBox Control team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests