dotnet / dotnet/wpf

TabControl tab get selected when a Button is pressed on a ToolBar

Open
#2,278 3 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

.NET Core Version: 3.0 (also .NET Framework 4.7.1 - 4.8 but not 4.6.2)
Windows version: 1903

1. Create a new WPF App and use the following XAML for the window (no extra code behind):

````xaml






Button






Button




````

2. Run the app and switch to the second Tab
3. Switch back to the first Tab and press Button

The TabControl changes the currently selected tab to the second tab while it's expected to stay on the first tab:

![image](https://i.stack.imgur.com/Q9sDH.gif)

A workaround is to set focused element for the Window:

````xaml






Button






Button




````

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.