Comments (5)
Describe the bug
When using a custom title bar that extends own content into the title bar, flyouts that are opened from the page UI over the custom title bar receive no input. The mouse input is interpreted as a hover and click on the title bar, not on the items in the flyout. Trying to click on or select the top item in the flyout is impossible and is instead interpreted as a window movement when clicking and dragging. Double-clicking on the top flyout item maximizes the window instead of selecting the flyout item.
Also, the title bar control buttons for minimize, maximize and closing the window are given priority over the flyout that is displayed above.
Steps to reproduce the bug
Reproduction sample code is available here: https://github.com/kjean667/WinUICustomTitleAndFlyoutBug
Use AppWindowTitleBar.ExtendsContentIntoTitleBar and SetDragRectangles to extend custom content into the title bar of the window. (See WindowTitleHelper.cs in reproduction sample)
Use a simple XAML Window with a Flyout that is tall enough to open over the custom title bar. The Window needs to be the exact right size so that the Flyout is extended over the title bar content.
<Window x:Class="WinUICustomTitleBarInhibitsControlInput.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid RowDefinitions="80,*"> <StackPanel x:Name="MenuBarContent" Grid.Row="0" Background="DarkBlue" Padding="16"> <TextBlock Text="Custom Title Bar" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/> </StackPanel> <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <Button Content="Click Me"> <Button.Flyout> <Flyout Placement="Right"> <ListView> <ListView.Items> <ListViewItem>Item 1</ListViewItem> <ListViewItem>Item 2</ListViewItem> <ListViewItem>Item 3</ListViewItem> <ListViewItem>Item 4</ListViewItem> <ListViewItem>Item 5</ListViewItem> <ListViewItem>Item 6</ListViewItem> <ListViewItem>Item 7</ListViewItem> <ListViewItem>Item 8</ListViewItem> <ListViewItem>Item 9</ListViewItem> </ListView.Items> </ListView> </Flyout> </Button.Flyout> </Button> </StackPanel> </Grid> </Window>
Expected behavior
The first item in the flyout shall be clickable and when hovering over the item the focus background shall be displayed.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.5.1: 1.5.240311000
Windows version
No response
Additional context
Windows 11 23H2 (22631.3155)
You could set flyout shouldconstraintorootbounds false
from microsoft-ui-xaml.
When using Flyout.ShouldConstrainToRootBounds="False", it works around the problem and items can be selected, but it still does not solve the original issue. Using unconstrained flyouts trigger other crashes in WinUI when trying to hide the flyout from code behind. In that case a native 0x80070057 "The parameter is incorrect" exception is thrown and crashing the application.
from microsoft-ui-xaml.
dup
#9448
from microsoft-ui-xaml.
For non-windowed flyouts, it might be good for flyout positioning code to ensure the flyout doesn't overlap the titlebar area. Or, alternatively, maybe the flyout could use InputNonClientPointerSource to ensure it gets input even if it is in the titlebar area.
from microsoft-ui-xaml.
For non-windowed flyouts, it might be good for flyout positioning code to ensure the flyout doesn't overlap the titlebar area. Or, alternatively, maybe the flyout could use InputNonClientPointerSource to ensure it gets input even if it is in the titlebar area.
Is there any sample?
from microsoft-ui-xaml.
Related Issues (20)
- The Print UI dialogue is not shown on the Windows platform when the "EntryPoint" is set as "Windows.PartialTrustApplication" in Package.appxmanifest. HOT 2
- The first time "microsoft." is typed into a TextBox control, it will be capitalized for no reason HOT 4
- Multiple x:Bind to Name fails to build HOT 4
- While scrolling through the rows in the DataGrid, the value of the ComboBox element in the DataGridTemplateColumn CellTemplate is not updated correctly HOT 2
- Scrolling through very large number of items in ItemsRepeater + virtualized Layout + ScrollView causes blank frames HOT 2
- Command Bar - Issue with the Z - Index flow when "More Options" flyout is open. HOT 1
- Unexpected items were obtained in a subclass of ItemsControl HOT 1
- [ListView] The app crash when try to use the right click during a reorder operation. HOT 1
- WinUI 3 Acrylic effect not working properly over MediaPlayerElement HOT 2
- Dragging a file from Explorer over top of the application window will launch another process HOT 1
- Proposal: Improve exception message for incorrect bound type using x:DataType
- ComboBox selects the wrong item after it is collapsed HOT 1
- ListView throws ArgumentOutOfRangeException when CollectionChanged is handled with Action = Reset HOT 1
- PublishSingleFile + no WindowsAppSDKSelfContained is broken HOT 4
- InputNonClientPointerSource.PointerReleased event is not invoked when the pointer is moved away while a button is pressed HOT 1
- resources.pri is missing when publish with --no-build option HOT 1
- InputNonClientPointerSource no longer works after removing titlebar with SetBorderAndTitleBar HOT 1
- MenuFlyout text color has the wrong theme when the IsEnable property is changed in CodeBehind and the application theme is different from the OS theme HOT 1
- MediaSource.ExternalTimedTextSources.Clear causes unhandled exception if loaded TimeTextSource was not valid HOT 1
- Pivot Item Content disappears from Pivot when dragging HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-ui-xaml.