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

Would be incredible to have native support for details/summary; so they are auto-expanded on errors

Open alexbjorlig opened this issue 1 year ago • 1 comments

When building complex forms, details/summary is really awesome.

It can show/hide complex/detailed part of a large form, but things are still in the DOM.

But when it comes to error handling, details/summary elements are not expanded if they contain an error. Better illustrated with a video.

https://github.com/user-attachments/assets/2315e2f8-57d7-418e-b5cd-519b85aba54c

Playground link here.

alexbjorlig avatar Oct 31 '24 18:10 alexbjorlig

It seems to work to link the open attribute to $errors:

https://www.sveltelab.dev/njaj00nf276jafr

ciscoheat avatar Nov 01 '24 08:11 ciscoheat