-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUG] - onClick handler is not triggered by keyboard #3378
Comments
I am working on it. |
The Bug is very simple to solve, <Button onClick={() => alert("Clicked")}>Button</Button> You need to use Use this <Button onPress={() => alert("Clicked")}>Button</Button> I hope this resolves the issue. |
onPress in not available for web it is generally used in react native. |
@wingkwong this is generally occuring in every component do you want me to change it for every component. or how do you want me to proceed. |
@Inbestigator @abhisektomar1 Your statement is not correct. We do support onPress and other press events. For those who wonder why |
NextUI Version
2.4.2 and @nextui-org/button@2.0.34
Describe the bug
onClick
handler is not triggered when activating<Button>
with keyboard.This behavior isn't unique to buttons and happens on some other components (checkbox, switch)
Your Example Website or App
https://broken-nextui-components.vercel.app/
Source code for example: https://github.com/Inbestigator/broken-nextui-components
Steps to Reproduce the Bug or Issue
Expected behavior
onClick
handler is triggered as it normally happens for<button>
element in React.Screenshots or Videos
No response
Operating System Version
Windows
Browser
Chrome and Firefox
The text was updated successfully, but these errors were encountered: