Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accelerator Underlines get stuck on after first key UNLESS a menu item has been shown once for the application. #17772

Open
tomlm opened this issue Dec 14, 2024 · 0 comments
Labels

Comments

@tomlm
Copy link

tomlm commented Dec 14, 2024

Describe the bug

If you have AccessKeys defined on labels/buttons etc they don't display correctly unless the application has shown a menu at least once.

To Reproduce

  1. create a new avalonia app
  2. Change the mainwindow to look like this:
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="AvaloniaApplication2.MainWindow" >
  <StackPanel Orientation="Vertical">
<!--   <Menu/> -->
    <Label Target="firstNameEdit">_First name</Label>
    <TextBox Name="firstNameEdit"></TextBox>
  </StackPanel>
</Window>
  1. Run the app, hit the Alt key multiple times. The first ALT key will show underlines, but after that it will be stuck on.
  2. Uncomment the MENU in the xaml
  3. Try again, Alt keys will toggle the underline on/off.

It doesn't matter when or where the menu is displayed (it does not have to be part of the visual tree). The accelerator key visualization only works after a menu has been displayed at least once for the application.

Expected behavior

The menu should not be needed to for accelerator key visualization to work correctly.

Avalonia version

11.2.1

OS

Windows

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant