microsoft / microsoft/microsoft-ui-xaml
Tapped event works on Back/Forward (XButton1 and XButton2) mouse button clicks
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Tapped event works on Back/Forward (and middle, btw) mouse button clicks
### Why is this important?
We have NavigationView component, that has 'back' icon. But when you try to handle XButton1 on window scope - it still triggers tapped on every component inside window. Because `TappedRoutedEventArgs` don't have additional information about mouse buttons, it's impossible to use Tapped handler anywhere inside window.
Workaround with PointerReleased is not really good because when user pressed mouse on one component but released on another one it is still triggers.
### Steps to reproduce the bug
```
```
```
private async void OnTapped(object sender, TappedRoutedEventArgs e)
{
///
}
```
### Actual behavior
Mouse back/forward trigger event handler.
### Expected behavior
Mouse back/forward do not trigger event handler.
### Screenshots
_No response_
### NuGet package version
2.3.1
### Windows version
Windows 11 (26H1): Build 28000
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the issue with the Border XAML and OnTapped handler shown in the report, then trace how XButton1 and XButton2 mouse input reaches the Tapped event. Done means Back/Forward mouse clicks no longer raise Tapped, while ordinary taps and the existing navigation behavior remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100