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

Focus Border Behavior Differs Between Windows App SDK 1.5 and 1.6 #4992

Open
Ajith-GS opened this issue Dec 20, 2024 · 0 comments
Open

Focus Border Behavior Differs Between Windows App SDK 1.5 and 1.6 #4992

Ajith-GS opened this issue Dec 20, 2024 · 0 comments

Comments

@Ajith-GS
Copy link

Ajith-GS commented Dec 20, 2024

Describe the bug

The behavior of focus borders has changed between Windows App SDK versions 1.5 and 1.6.
In Windows App SDK 1.5, when a control (e.g., a button) placed inside a ScrollViewer gains focus via the keyboard, clicking outside the control dismisses the focus border, indicating that the control has lost focus.
In Windows App SDK 1.6, the same action does not dismiss the focus border. Even after clicking outside the control, the focus border remains visible, indicating that the control retains focus.
This behavior change affects how focus is visually managed and may lead to inconsistencies in user experience, especially in scenarios relying on traditional focus dismissal behavior.

Steps to reproduce the bug

  1. Create a WinUI 3 application.
  2. Ensure that the installed Windows App SDK version is 1.6. If not, update to 1.6.
  3. In MainWindow.xaml file, replace the existing code with following code .
    <ScrollViewer>
        <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="20">
            <CheckBox Content="Two-state CheckBox"/>
            <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
        </StackPanel>
    </ScrollViewer>
  1. Build and run the application.
  2. Use the keyboard to focus on the control(e.g., a button) .
  3. Click outside the control using the mouse.

Sample projects with Windows App SDK 1.5 and 1.6 attached to reproduce the issue.
Apps.zip

Expected behavior

The focus border around the control should be dismissed, indicating the loss of focus (as in Windows App SDK 1.5).

Actual Behavior

The focus border remains visible around the control, even after clicking outside (as in Windows App SDK 1.6).

Screenshots

No response

NuGet package version

Windows App SDK 1.6.3: 1.6.241114003

Packaging type

Packaged (MSIX), Unpackaged

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

If this is intentional, guidance on managing focus dismissal would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant