Skip to content

Commit

Permalink
Bare valider personsøk på submit. Fjern validering på blur
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaegrov committed Dec 9, 2024
1 parent 3cb7280 commit fdf2d9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/components/person-sok/PersonSok.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export function PersonSok() {
const validatedForm = useForm({
validator: hentValideringForPersonIdent(),
method: "post",
validationBehaviorConfig: {
initial: "onSubmit",
whenTouched: "onSubmit",
whenSubmitted: "onChange",
},
});

return (
Expand All @@ -23,6 +28,7 @@ export function PersonSok() {
placeholder="Søk etter person"
variant="secondary"
clearButton
onBlur={() => validatedForm.clearError("personIdent")}
error={validatedForm.error("personIdent")}
/>
</Form>
Expand Down

0 comments on commit fdf2d9c

Please sign in to comment.