[Feature Request] Support for onClick() again #4700
Replies: 5 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 |
Beta Was this translation helpful? Give feedback.
-
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"
}
} |
Beta Was this translation helpful? Give feedback.
-
This has really caused a lot of issues for us too. Especially since |
Beta Was this translation helpful? Give feedback.
-
I am more worried about all the third-party libraries that transparently inject |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions