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

When the CanFocus property is set to false, the Accepting event is executed 3 times #3905

Open
luizfernandonb opened this issue Feb 4, 2025 · 0 comments
Labels

Comments

@luizfernandonb
Copy link

To Reproduce
Steps to reproduce the behavior:

  1. Copy the code below
var window = new Window();
window.Title = "test1";

var btn = new Button();
btn.Title = "test2";
btn.X = Pos.Center();
btn.Y = Pos.Center();
btn.CanFocus = false;
btn.Accepting += (_, _) => {
    Debug.WriteLine("accept");
};

window.Add(btn);

Application.Init();
Application.Run(window);
Application.Shutdown();
  1. Run in your IDE or text editor

Expected behavior
The event will only be executed once

Screenshots
When executing the code above I have this in the Visual Studio output:
Image

If I comment out the CanFocus property code, I have this in the Visual Studio output:
Image

Desktop (please complete the following information):

  • OS: Windows 11 24H2 26100.2894
  • Browser: Microsoft Edge
  • Version: 132.0.2957.140

Additional context
It's in v2
Image

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