sveltekit-superforms icon indicating copy to clipboard operation
sveltekit-superforms copied to clipboard

`customValidity` for shadcn components

Open hbcondo opened this issue 1 year ago • 1 comments

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 avatar Sep 11 '24 19:09 hbcondo

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.

ciscoheat avatar Sep 13 '24 09:09 ciscoheat