Comments (4)
One more idea for me actually, implement ICustomKeyboardNavigation somewhere appropriate and use that to trap XYFocus within a tree.
EDIT: Won't work. None of the XYFocus methods that would be needed are public. They're all internal / private.
from avalonia.
https://learn.microsoft.com/en-us/windows/apps/design/input/focus-navigation#enabled
Looks like UWP behavior is supposed to prevent XY navigation between 2 sibling XYFocusKeyboardNavigation="Enabled" subtrees if their parent is explicitly disabled. See the second image in the linked section.
I'm not sure I think that's the right way to do it. Personally I feel having more explicit control over boundaries without having to disable XYFocus is the better way.
If desired though I could probably do a PR to implement UWP behaviour here as well.
from avalonia.
Digging into WinUI 3 code it behaves the same way, bubbling an XY navigation event up from the source until it finds a candidate to focus or hits a parent that isn't XY navigation enabled. See
https://github.com/microsoft/microsoft-ui-xaml/blob/66a7b0ae71c19f89c6a7d86a1986794ad1a1bf09/src/dxaml/xcp/core/dll/eventmgr.cpp#L1385C9-L1401C6
from avalonia.
I've started work on a PR to implement WinUI / UWP style subtree restrictions, and hit a snag with the XYFocus helpers.
@maxkatz6 did the original PR, so maybe you have some input.
private static bool IsAllowedXYNavigationMode(XYFocusNavigationModes modes, KeyDeviceType? keyDeviceType)
{
return keyDeviceType switch
{
null => true, // programmatic input, allow any subtree.
This always allows XYNavigation, even if the mode is XYFocusNavigationModes.Disabled, if the keyDeviceType is null. Which it is during all the Unit Tests using KeyboardNavigationHandler.GetNext(...) for Assert checks. So while all the Unit Tests set XYFocusNavigationModes.Enabled to the Window used, very few actually respect it intentionally. Is that really intended behaviour, or should the null case instead be true if modes != Disabled?
from avalonia.
Related Issues (20)
- Color binding on slider thumb background property in fluent theme not working properly HOT 5
- Listbox.clear does not go to the top automatically
- GlyphTypeface.Name does not represents the correct family name for extended families
- ComboBox ItemsSource does not support ObservableCollection's View HOT 4
- DrawingContext state is broken in some cases HOT 1
- System.InvalidOperationException: Could not create glyphTypeface on Linux after upgrade to version 11.1.x HOT 4
- Binding OneTime does not work HOT 1
- Incorrect Coordinates Retrieved by PointToScreen on Linux in Loaded and Activated Events HOT 5
- Unsupported IBinding implementation after migration on 11.1 HOT 8
- Can't build in release mode. Can't find SimpleTheme HOT 2
- Tooltip doesn't disapear after mouse moves away HOT 2
- updated to 11.1.2 and the browser project does not build because it does not find the namespace avalonia.browser HOT 1
- WebRTC Support with Avalonia for Android and iOs HOT 2
- Avalonia.Browser RenderWorker and some other new classes shouldn't be public HOT 3
- ToolTip's Tip fails to be passed as CommndParameter HOT 2
- writeablebitmap performance issues HOT 3
- ListBox inside Popup not scrolling with PointWheelChanged HOT 7
- Memory leak with ProgressBar when IsIndeterminate="True"
- TrayIcon not visible on Linux Mint 22 Cinnamon HOT 2
- Default button press no longer triggered on input submit HOT 4
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 avalonia.