Open EirikOlavHaugenSSB opened 8 months ago
Seems to be an issue for most if not all applications. For 3 schemas I have tested at least.
@EirikOlavHaugenSSB Did you try to set validateOnNext
on the navigation buttons for that page? See the docs here: https://docs.altinn.studio/app/development/ux/pages/navigation/#validation-on-page-navigation
The default functionality in Altinn 3 forms is to not show validation messages about required fields until the user tries to submit the form, but you can override that setting if you have to (for example if the user has to fill out a field in order for the rest of the form to make sense by hiding/showing the correct fields, etc).
validateOnNext is set currently as: validateOnNext": { "page": "current", "show": [ "All" ] }
The page works "properly" if you are sufficiently slow to click the next button after answering "yes" to the pervious question (around 0.5 seconds). I am planning to run this validateOnNext for all pages in the form, but have only applied it to a few pages for testing at the moment. Anything I can supply to make it easier to reproduce? I believe it's possible to do it in most forms, but it's easier to do it when there's more things to load as the form is slower.
Thanks! I think it makes sense, then. I'll link in this issue as related, as I'm working on general performance improvements that might fix this problem as well:
Yesterday I found a bug I think is related to this one. With a yes/no question that hides the next page when you select "no" and shows it when "yes" is selected. Going from having picked "yes" to picking "no" and clicking the "next" button quickly it will take you all the way back to the first page instead of the next page. I suspect it's some sort of default to return to the start when the form is trying to reach a page which is currently hidden.
I believe this is no longer an issue since the navigation-buttons locks down and becomes unclickable when you fill out parts of the form?
Description of the bug
If you have a component which is required to answer, but only appears after answering another one on the same page, it's possible to click the skip button before the component is able to load. If the next pages also depend on the question being answered it might skip or mess up the following pages if they depend on the answers before.
It seems the slower the component loads the easier it is to perform.
Steps To Reproduce
Example:
Additional Information
No response