Skip to content

Collapse CurrencySecondaryStatus when no text is present in the text block#467

Merged
danbelcher-MSFT merged 6 commits intomicrosoft:masterfrom
EriWong:eriwong/313
Apr 23, 2019
Merged

Collapse CurrencySecondaryStatus when no text is present in the text block#467
danbelcher-MSFT merged 6 commits intomicrosoft:masterfrom
EriWong:eriwong/313

Conversation

@EriWong
Copy link
Copy Markdown
Contributor

@EriWong EriWong commented Apr 19, 2019

Fixes #313

In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window #313

Description of the changes:

  • Adds an x:Name to the CurrencySecondaryStatus text block
  • Adds a NormalCurrencyStatus visual state to the CurrencySecondaryStatusStates
  • Adds functionality to the CurrencySecondaryStatusStates to show or hide the CurrencySecondaryStatus text block.

How changes were validated:

  • Verified that the textblock is not visible in the accessibility tree via inspect.exe from the windows sdk.
  • Verified that Narrator also does not stop on the block when in scan mode.
  • Verified that the textblock is visible in the accessibility tree and read out in Narrator when the ChargesMayApplyCurrencyStatus or FailedCurrencyStatus viewstates are set.

EriWong added 3 commits April 19, 2019 10:22
Collapses the currency status textblock when the contents are empty to avoid adding an element in the accessibility tree.
@EriWong EriWong changed the title Eriwong/313 Collapse CurrencySecondaryStatus when no text is present in the text block Apr 19, 2019
@danbelcher-MSFT danbelcher-MSFT self-assigned this Apr 19, 2019
@rudyhuyn
Copy link
Copy Markdown
Contributor

rudyhuyn commented Apr 20, 2019

Alternative solution to solve the root cause of the issue (the narrator thinking that the textblock isn't empty because of the half space character):

Only replace:

                        <TextBlock Margin="0,7,0,0" Style="{ThemeResource CaptionTextBlockStyle}">
                            <Run x:Name="Spacing" Text="&#x200A;"/>
                            <Run x:Name="CurrencySecondaryStatus"
                                 FontWeight="SemiBold"
                                 Text=""/>
                        </TextBlock>

by

                        <TextBlock x:Name="CurrencySecondaryStatus"
                                   Margin="3,7,0,0"
                                   Style="{ThemeResource CaptionTextBlockStyle}"
                                   FontWeight="SemiBold"/>

(Margin="3,8,0,0" would be even better to correctly align the button and the textblock)

Tested with Narrator and with scan mode activated and with RtL

Copy link
Copy Markdown

@danbelcher-MSFT danbelcher-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. Thanks @EriWong! Also thanks to @rudyhuyn for helping find the simple solution 👍

@danbelcher-MSFT danbelcher-MSFT merged commit 2a29947 into microsoft:master Apr 23, 2019
EriWong added a commit to EriWong/calculator that referenced this pull request Jun 5, 2019
…block (microsoft#467)

Fixes microsoft#313
In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window microsoft#313

Description of the changes:
Adds an x:Name to the CurrencySecondaryStatus text block
Adds a NormalCurrencyStatus visual state to the CurrencySecondaryStatusStates
Adds functionality to the CurrencySecondaryStatusStates to show or hide the CurrencySecondaryStatus text block.

How changes were validated:
Verified that the textblock is not visible in the accessibility tree via inspect.exe from the windows sdk.
Verified that Narrator also does not stop on the block when in scan mode.
Verified that the textblock is visible in the accessibility tree and read out in Narrator when the ChargesMayApplyCurrencyStatus or FailedCurrencyStatus viewstates are set.
@EriWong EriWong deleted the eriwong/313 branch November 17, 2019 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window

3 participants