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

Button does not accept clicks on its entire size #16179

Open
CodeDevAM opened this issue Jul 1, 2024 · 3 comments
Open

Button does not accept clicks on its entire size #16179

CodeDevAM opened this issue Jul 1, 2024 · 3 comments
Labels

Comments

@CodeDevAM
Copy link

Describe the bug

When a button has a big horizontal extend it has a relatively large area on the left and on the right where a click does not get accepted.

On mouse down the button shrinks and it seems to only accept clicks on mouse release on the shrinked button size.

Window.2024-07-01.09-39-54.mp4

To Reproduce

Should be reproducable with any large button but may depend on the theme and the styling.

Expected behavior

A button is accept clicks on its entire size

Avalonia version

11.1.0

OS

Windows

Additional context

No response

@CodeDevAM CodeDevAM added the bug label Jul 1, 2024
@stevemonaco
Copy link
Contributor

This is because Fluent theme shrinks the Button while pressed and Button requires the pointer to be within its bounds upon release for a click event to occur.

The easiest way is to replace the shrinking behavior below via styling:

https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/Button.xaml#L51-L53

See #16100 for details.

@CodeDevAM
Copy link
Author

Thanks for the advise.

However I would consider this as an unexpected behaviour. In my opinion the click logic of a button should work on the original size of the button when the mouse is pressed down. Because otherwise the UI do feel unresposive when you hit the button at the wrong place.

@maxkatz6
Copy link
Member

maxkatz6 commented Jul 8, 2024

Probably a duplicate of #7626

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

3 participants