Altinn / Altinn/app-frontend-react
Ability to show validation errors when leaving a field
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
Currently in V4 we continuously validate the data from the user, but we can configure WHEN to show the error messages from those validations. Currently you can show validation errors immediately (while typing) or when navigating to the next page.
Immediately can be annoying as long as you still are typing and on navigation to the next page can be a bit late in addition to that you can get a long list of validation errors if you have multiple errors.
The example below shows the datepicker component show an error message immediately while the user has just begun to type the value.
### Additional Information
[Best practices related to error messages](https://github.com/Altinn/app-frontend-react/issues/1762)
#### How it looks
https://github.com/Altinn/app-frontend-react/assets/5430430/9f8c9878-61d9-4c8b-95dd-61718aa86ebf
### Tasks
_No response_
### Acceptance Criterias
- [ ] Possible to show error message when leaving the field
Contributor guide
Research direction
Start with the datepicker component and the existing validation display configuration described in the issue. Trace how validation messages are shown immediately and on navigation, then define the field-leave trigger; done means an error can be displayed when the user leaves a field without waiting for page navigation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100