ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.24k stars 66 forks source link

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

Open alexbjorlig opened 1 week ago

alexbjorlig commented 1 week ago

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.

ciscoheat commented 1 week ago

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

https://www.sveltelab.dev/njaj00nf276jafr