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] - Select component does not trigger html form change #4111

Open
micama opened this issue Nov 18, 2024 · 4 comments
Open

[BUG] - Select component does not trigger html form change #4111

micama opened this issue Nov 18, 2024 · 4 comments
Labels
🐛 Type: Bug Something isn't working

Comments

@micama
Copy link

micama commented Nov 18, 2024

NextUI Version

2.4.8

Describe the bug

Within a plain html form we have a validation that works through the form's onChange event and respective callback method.
The NextUI components like Input trigger the onChange event of the form, however the Select component does not!
This is unexpected. The expectation is for it to behave the same as the native select component, i.e. trigger the onChange event.
See the attached example URL.

Thanks

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-vp1lwv?file=src%2FApp.tsx

Steps to Reproduce the Bug or Issue

  1. Use the native components (input, select) => the form onChange is triggered and logged
  2. Make a selection on nextui Select component => no troggering of the form's onChange

Expected behavior

The NextUI's Select component should behave the same as the native one, i.e. trigger it's surrounding form.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

Copy link

linear bot commented Nov 18, 2024

@responsive-mind
Copy link

Yes, I have the same issue. The Select component not triggering the form's onChange event is unexpected. It should behave like the native select element for consistency with standard HTML behavior

@micama
Copy link
Author

micama commented Nov 19, 2024

The same behaviour (not triggering the form event) is also observed for the Checkbox component.

@mdfaizanahmed786
Copy link

I can work on this issue. Let me know if you have any questions. Thank you!

@ryo-manba ryo-manba added the 🐛 Type: Bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants