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 doesn't dispatch onClick event on click on the edges of it #1766

Open
Andrew-Zakharov opened this issue Nov 24, 2023 · 6 comments
Open
Labels
bug Something isn't working contribution welcome

Comments

@Andrew-Zakharov
Copy link

For some reason when click on the button's edges it doesn't dispatch onClick although click animation is being played

Screen.Recording.2023-11-24.at.13.33.09.mp4
@talkor talkor self-assigned this Nov 26, 2023
@talkor talkor added the bug Something isn't working label Nov 27, 2023
@talkor
Copy link
Member

talkor commented Nov 27, 2023

Thanks for reporting @Andrew-Zakharov! It's a known issue, happens because we scale down the button when it's active so the clickable area is getting smaller and the event is not called. You can use onMouseDown prop instead, it will be called even when clicking on the edges. Just make sure to cover keyboard event as well

Alternatively, you can disable the animation using preventClickAnimation

@talkor talkor removed their assignment Nov 27, 2023
@Andrew-Zakharov
Copy link
Author

I see, thank you for the explanation 👍

@Ma1kovich
Copy link

@talkor are there any plans on fixing it directly in the package?

@talkor
Copy link
Member

talkor commented Dec 3, 2023

@talkor are there any plans on fixing it directly in the package?

Not at the moment but contribution is welcome :)

@RitikBora
Copy link

Hey @talkor
The diffrence between onMouseDown and onClick is marginal. Mouse down event is fired when the button is pressed and onClick when a full click is registered. Basically after the click event

Is it ok if we dispach onClick on MouseDown as well? Will this hamper the workflow in any manner?

@talkor
Copy link
Member

talkor commented Feb 21, 2024

Hey @talkor The diffrence between onMouseDown and onClick is marginal. Mouse down event is fired when the button is pressed and onClick when a full click is registered. Basically after the click event

Is it ok if we dispach onClick on MouseDown as well? Will this hamper the workflow in any manner?

Hey @RitikBora! Yes that's definitely ok, this is also the workaround suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contribution welcome
Projects
None yet
Development

No branches or pull requests

4 participants