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

[BUG?] - Using Modal/Drawer as form hitting Enter closes the modal #4516

Open
J4v4Scr1pt opened this issue Jan 8, 2025 · 7 comments
Open

Comments

@J4v4Scr1pt
Copy link

J4v4Scr1pt commented Jan 8, 2025

NextUI Version

2.6.11

Describe the bug

Maybe I'm doing something wrong here using the Modal/Drawer as a form, but it's the most convenient way to wrap both Footer and Body. ModalContent don't accept a action prop so can't use that as the form.

The Modal has inputs that are required and it uses ServerAction for submitting.
This is how I always have used it and for some reason this has changed during the latest updates.

Your Example Website or App

https://codesandbox.io/p/devbox/frosty-bhaskara-j53crw

Steps to Reproduce the Bug or Issue

Open CodeSandbox.
Open the modal.
Click in a Input.
Hit Enter.

Expected behavior

Tbh I could be wrong here, but I would Expect it to not close because the inputs have no values and are requierd.

Screenshots or Videos

No response

Operating System Version

Window 11

Browser

Chrome

Copy link

linear bot commented Jan 8, 2025

@wingkwong
Copy link
Member

I couldn't access your sandbox. Please make it public.

@J4v4Scr1pt
Copy link
Author

I couldn't access your sandbox. Please make it public.

Man sry, it should be public now!

@wingkwong
Copy link
Member

still not able to access

image

@J4v4Scr1pt
Copy link
Author

still not able to access

image

I do not understand what is happening here..
But try again plz: https://codesandbox.io/p/devbox/frosty-bhaskara-j53crw

@J4v4Scr1pt
Copy link
Author

@wingkwong Codebox worked now right?

@wingkwong
Copy link
Member

wingkwong commented Jan 9, 2025

@J4v4Scr1pt yes. this needs further investigation as i haven't used as form in modal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants