ciscoheat / sveltekit-superforms

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

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

Open alexbjorlig opened 3 weeks ago

alexbjorlig commented 3 weeks 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 3 weeks ago

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

https://www.sveltelab.dev/njaj00nf276jafr