-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Feature Request] Support for onClick() again #4545
Comments
can you elaborate more which component and which versions are you using? Regarding supporting onClick again, we understand this may cause the inconvenience. Please note that this is the decision made by the |
onPress is an event implemented by react-aria that modifies many native events. This means that if downstream components use onClick instead of onPress, various issues may arise, such as the child component's onClick event being blocked by the parent. Even when using onPress, I still encounter several problems (for example, poor responsiveness when clicking near the edges of elements on mobile devices). In contrast, onClick is very stable; mixing it with onPress doesn't seem to cause major issues—only minor accessibility-related concerns—but I prefer to prioritize typical scenarios. My approach has been to fix certain dependency versions. So far, everything works well even with the latest NextUI (although there are deprecation warnings, they don't have any actual impact since warnings and handling logic are separated; the handling logic is in newer versions of use-aria-button and use-aria-link). "pnpm": {
"overrides": {
"@react-aria/interactions@^3.22.3": "3.22.2",
"@nextui-org/use-aria-button@^2.2.3": "2.2.2",
"@nextui-org/use-aria-link@^2.2.3": "2.2.2"
}
} |
Is your feature request related to a problem? Please describe.
On mobile devices, the onPress() event doesn't work and doesn't trigger anything. It was not really a problem before because you could just use onClick() but now it is deprecated. onClick() is still working, but it's weird to get warnings from somthing, you need to use for normal usability.
Describe the solution you'd like
It would be great to support onClick() again.
Describe alternatives you've considered
I'm still using onClick() but I'm getting the deprecated warnings.
Screenshots or Videos
No response
The text was updated successfully, but these errors were encountered: