Open mkrecek234 opened 2 years ago
Is there any current demo on which this issue can be reproduced or can you post a minimalistic code to reproduce?
@mvorisek No, there is not yet an example but it is very simple: If you have a form with an Accordion layout inside, and one field does not validate, the form is reloaded on save, the error message is attached to the failing field, but the user can't see it if the field is in one of the (closed) Accordions. Very confusing for the user. This also would apply to tabs I assume.
Improved behaviour: If validation fails, for the first invalid field that is inside an Accordion, that Accordion is activated automatically.
@ibelar something for you eventually?
Accordion Section activate on error is/was supported and was fixed by https://github.com/atk4/ui/pull/1863.
This issue is about general support. A test for Accordion and Tab should be added. And both must be activated even if insined nested structure, like Accordion->Tab->Tab->Accordion->section with an error.
https://app.codecov.io/gh/atk4/ui/pull/2032/blob/src/Form/Layout/Section/Accordion.php - needs to be covered by a Behat test
I am using heavily Acccordion sections to structure forms (e.g. Customer, Address, Payment, Shipping, Tax) - the way I do this is to make one form, and inside the form we have the Accordions.
However if a Validation for a field inside a closed Accordion fails, it seems to the user nothing happens on Submit. Can we automatically open the Accordion(s) where fields with failed Validation messages are present?