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

customValidity for shadcn components #477

Open
hbcondo opened this issue Sep 11, 2024 · 1 comment
Open

customValidity for shadcn components #477

hbcondo opened this issue Sep 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@hbcondo
Copy link

hbcondo commented Sep 11, 2024

customValidity works well for input fields but it would be great to support shadcn components. For example, shadcn's Select component renders button and div tags so the tooltip doesn't appear when trying to enforce a user to select an option from the dropdown.

@hbcondo hbcondo added the enhancement New feature or request label Sep 11, 2024
@ciscoheat
Copy link
Owner

Hi, customValidity uses the name attribute to find the correct field, so the trick should be to add a matching name attribute to the native html field that is eventually generated by shadcn.

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

No branches or pull requests

2 participants