Skip to content

OrganisationLookup component bypasses required field validation on bound data model field #4141

@at-bgp

Description

@at-bgp

Description of the bug

When an OrganisationLookup component is bound to a data model field that is marked as required (Påkrevd), the required validation is not enforced. The user can submit the form without filling in the organisation number.

Steps To Reproduce

Steps to reproduce

  1. In the data model, mark EngasjertVirksomhet.Organisasjonsnummer as required (Påkrevd toggled on).
  2. In a RepeatingGroup, add an OrganisationLookup component bound to EngasjerteVirksomheter.Organisasjonsnummer:
// Example
{
  "id": "EngasjerteVirksomheterOrganisationLookup",
  "type": "OrganisationLookup",
  "dataModelBindings": {
    "organisation_lookup_orgnr": {
      "field": "EngasjerteVirksomheter.Organisasjonsnummer",
      "dataType": "skjema"
    }
  }
}
  1. The RepeatingGroup has "validateOnSaveRow": ["Required"] configured.
  2. Add a row to the repeating group and attempt to save/submit without entering an organisation number.

Expected behavior

Validation should prevent the user from saving the row and/or submitting the form, showing a required-field error on the OrganisationLookup component.

Actual behavior

No required validation error is shown. The user can save the row and submit the form with Organisasjonsnummer empty.

Additional Information

Repository: https://altinn.studio/repos/dat/forhandsmelding
Component: OrganisationLookup (altinn-app-frontend)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't workingsquad/dataIssues that belongs to the named squad.

    Type

    No fields configured for Bug.

    Projects

    Status

    📈 Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions