You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Command Flyout command buttons are not working with FA added. Nor is the SelectableTextBlock. They key bindings work as expected, its just they don't seem to work when you use the buttons on the flyouts.
It works fine in the sample app from the master branch, not sure if this is a bug or if i am just initializing something wrong.
Video of it not working:
Recording.2024-06-26.114728.mp4
Video of it working without FA installed:
Screen.Recording.2024-06-26.115114.mp4
Desktop/Platform:
OS: Windows 11
FluentAvalonia Version 2.1.0-preview6 (older previews as well)
Avalonia Version 11.1.0-rc1
Reproduction:
This is just a empty .NET 8 application with the latest previews install of Avalonia and FluentAvalonia.
cricketthomas
changed the title
TextBox flyout commands and SelectableTextBox commands buttons not working
TextBox flyout commands and SelectableTextBox command buttons not working
Jun 26, 2024
FluentAvalonia's CommandBarFlyout.cs calls HideCore(false) inside OnCommandBarButtonInSecondaryCommandsClick(object sender, RoutedEventArgs e), which occurs whenever one of the buttons is clicked. I think the Click event must be firing before the command method (e.g. ExecuteCutCommand() in TextCommandBarFlyout.cs) executes. So the command method reads Target as null and doesn't do anything.
I tried commenting out HideCore(false) to test this and it made the button commands work again but left visual artifacts as it no longer gets properly hidden. I'm not familiar enough with this code to suggest the best way to fix it.
This should now be fixed in master. To work around the issue, TextCommandBarFlyout now holds a WeakReference to the Target control when it opens so it still has access to that when it closes. I may look back at the WinUI source in the future to see if there's a better fix, but this will do for now.
Describe the bug
Command Flyout command buttons are not working with FA added. Nor is the SelectableTextBlock. They key bindings work as expected, its just they don't seem to work when you use the buttons on the flyouts.
It works fine in the sample app from the master branch, not sure if this is a bug or if i am just initializing something wrong.
Video of it not working:
Recording.2024-06-26.114728.mp4
Video of it working without FA installed:
Screen.Recording.2024-06-26.115114.mp4
Desktop/Platform:
Reproduction:
This is just a empty .NET 8 application with the latest previews install of Avalonia and FluentAvalonia.
https://github.com/cricketthomas/AvaloniaApplication2
The text was updated successfully, but these errors were encountered: