-
-
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
[BUG] - Button onPress
event flaky in modal
#4451
Comments
onPress
event flaky in modal
Because of this issue, as well as another problem I encountered in a newer version, I fixed the version used in my production environment to 2.6.5. Apart from a minor issue with the Popover-based animation, I haven't received any other error reports. In version 2.6.5, I can use onClick. I'm not that focused on accessibility; instead, I prefer the elements on the page to respond correctly to most people's interactions. Also report in #4322 (comment) . |
With the latest version and the deprecation in more components, I have a lot of test that not pass now with onPress. Mainly on submit button in modal. |
Please provide a minimal sandbox for your modal setup with the flaky test result. |
@coratgerl not 100% sure is the same issue, but I identified a very similar problem using Button inside forms after migrating to 2.6.10 (also tested 2.6.11). Here a reproducible example: https://codesandbox.io/p/sandbox/qzmwk4?file=%2Fsrc%2FApp.tsx Using the Button with onPress makes the form to be submitted |
I am not sure that is the same issue, because in my case the form is never submitted, but interesting ! I try to create a minimal sandbox but it is hard because I have a complex environnement for my tests. |
NextUI Version
2.6.8
Describe the bug
I have a modal with a button to submit a form inside the modal. On a playwright test the event onPress is not trigger if I don't wait 500 ms before click on button. This work with
onClick
event. There is no state update on my side that can flaky my code. My test also check that my button is enabled before click and this step works.Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Not sure how to reproduce because it is very specific on this modal, but my modal look like this :
Expected behavior
The onPress is call
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered: