components
components copied to clipboard
[Form] Accessibility improvement
Provide a general summary of the issue here
It is common that after submitting a form the first input with an error is in focus, can we implement this as well? (Comment from Anna Karon during sprint review)
Sometimes the error summary is in focus after submit as well?
What is the right solution?
🧢 Your Product/Team
No response
### Tasks
- [x] Find out what the right solution is (call with Anna)
- [x] leave the right solution in the comment section
- [x] Implement the comments from the discussion with Anna (https://github.com/sl-design-system/components/issues/1292#issuecomment-2199336947
Conclusions from Anna:
When the user submit the form and there is an error in any field:
- The focus must be move to the 1st form field with error.
- The summary of errors must be positioned close to the submit button.
- As a nice to have, the error summary can be dynamic update (deleting the fixed form field from the list) when the user start to fix the field with errors. Also, when all the errors are fixed don't delete or hide the error message and change it from danger status to info status with a confirmation message that all errors are fixed.