Altinn / Altinn/app-frontend-react

Incorrect validation message for exclusive number range checks

Open
#3,424 0 comments 0 reactions 0 assignees View on GitHub
kind/bug
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

### Description of the bug

During a Studio course, a user discovered this bug in the Studio preview.

The validation message for number inputs with an exclusive range check is incorrect. When a value equal to the boundary is entered (e.g., entering 10 for a "greater than 10, exclusive" rule), an error is correctly triggered. However, the accompanying error message is wrong.

### Steps To Reproduce

1. Create a input component.
2. In the data model, set a validation rule for "Number greater than 10, exclusive".
3. In the preview/app, enter the value `10` into the field.
4. Observe the incorrect validation message: "Minste gyldig tall er 10".
5. Repeat the process for a "Number less than 10, exclusive" rule.
6. Enter the value `10`.
7. Observe the incorrect error message: "Største gyldig tall er 10".

### Additional Information

The validation for inclusive ranges appears is working correctly. The issue is specific to the text of the error message for exclusive ranges.

![Image](https://github.com/user-attachments/assets/737aa67a-4e73-4ab2-8db3-41c77df37b4e)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the exclusive greater-than and less-than validation cases in the Studio preview, then trace where their validation messages are defined. Done means boundary values still trigger errors and the messages accurately describe the exclusive range instead of reporting the boundary as valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.