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

Tab navigation is broken when RadioButtons is first Control in visual tree #3021

Closed
jwmsft opened this issue Jul 31, 2020 · 2 comments · Fixed by #3048
Closed

Tab navigation is broken when RadioButtons is first Control in visual tree #3021

jwmsft opened this issue Jul 31, 2020 · 2 comments · Fixed by #3048
Labels
area-RadioButtons team-Controls Issue for the Controls team

Comments

@jwmsft
Copy link
Member

jwmsft commented Jul 31, 2020

Describe the bug
When RadioButtons is the first control in the visual tree, Tab navigation does not behave as described in the documentation.

  1. Initial focus is set to the second control in the visual tree, not to the first RadioButtons control.
  2. When Tab focus reaches the first RadioButtons control, the first radio button in the list always gets focus, even when another option is selected.

Steps to reproduce the bug
Create a blank UWP project and add this XAML.

<Page ... >

    <StackPanel>
        <muxc:RadioButtons Header="Options A">
            <x:String>Option 1</x:String>
            <x:String>Option 2</x:String>
            <x:String>Option 3</x:String>
        </muxc:RadioButtons>

        <muxc:RadioButtons Header="Options B">
            <x:String>Option 4</x:String>
            <x:String>Option 5</x:String>
            <x:String>Option 6</x:String>
        </muxc:RadioButtons>
    </StackPanel>
</Page>

Issue 1 Steps to reproduce:

  1. Run the app. Focus is not set.
  2. Press the Tab key.

Expected behavior
Initial focus is set to the first radio button in the first group, Option 1.
Actual behavior
Focus is set to the second control in the visual tree; in this case, the first radio button in the second group, Option 4.

Issue 2 Steps to reproduce:

  1. Select an option in the first group (e.g - Option 3).
  2. Select an option in the second group (e.g - Option 5).
  3. Press Tab several times to cycle between the groups.

Expected behavior
Per documentation, "When a radio button is selected and a user tabs into the list, the selected radio button gets focus."
Actual behavior
When a user tabs into the first group, the first option always gets focus, regardless of whether an item is selected.

Version Info

NuGet package version:
[Microsoft.UI.Xaml 2.4.2]
[Microsoft.UI.Xaml 2.5.0-prerelease.200708003]

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jul 31, 2020
@Felix-Dev
Copy link
Contributor

I would like take a look into this.

@Felix-Dev
Copy link
Contributor

@jwmsft

Initial focus is set to the second control in the visual tree, not to the first RadioButtons control.

In your repro code, Focus is in the first RadioButtons control ("Option A"). While you don't see a focus rectangle, you can press the Space key to select the first item of "Option A" ("Option 1") or you can press the down arrow key to select the remaining items in "Option A".

I am working on a fix for issue 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-RadioButtons team-Controls Issue for the Controls team
Projects
None yet
4 participants