-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Describe the bug
FocusManager.Focus() ultimately calls KeyboardDevice.SetFocusedElement.
However, since #18373, a focus change can be cancelled. If it is, that information is not propagated back to the FocusManager, which incorrectly sets the wrong FocusedElement to the current focus scope.
To Reproduce
- Call
FocusManager.Focus - Handle
FocusChangingand callTryCancelon the event arguments. - Notice that
FocusManager.FocusedElementon the current scope has still be changed.
Expected behavior
When FocusManager.Focus() internally calls KeyboardDevice.SetFocusedElement(), it should verify that the focused element effectively changed. If it didn't or was redirected, the focused element should be updated to the current element, and Focus() should return false.
Avalonia version
12.0.0-rc2, master
OS
No response
Additional context
No response
Reactions are currently unavailable