feat: add max and min options to number input#1480
Conversation
| }) | ||
| ), | ||
| numberMin: Yup.number() | ||
| .typeError('Minimum score must be a number') |
There was a problem hiding this comment.
suggestion: Should we also call this "Value must be a number" the same as for numberMax test?
There was a problem hiding this comment.
missed chnaging that one thanks!
| component={TextField} | ||
| fullWidth | ||
| inputProps={{ 'data-cy': 'numberMin' }} | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => { |
There was a problem hiding this comment.
suggestion: I noticed that when the value for minimum/maximum is cleard it hides the checkbox, which keeps the state. It is just maybe little illogical to have min set as null and it being inclusive? Maybe we should clear the flag/checkbox (inclusive) in that case? See the recording.
Kooha-2026-05-26-13-49-58.webm
There was a problem hiding this comment.
updated it to reset to false on the blur event when min is cleared
jekabs-karklins
left a comment
There was a problem hiding this comment.
I am approving as it looks good, but I added two small comments still please check them.
Closes UserOfficeProject/issue-tracker#252
Description
This PR introduces min and max options to the number input fields in the application.
Motivation and Context
The change was required to provide more flexibility and control over the input fields, enabling the application to handle a wider range of data validation scenarios and improve the user experience.
Changes
numberMin,numberMax,numberMinInclusive,numberMaxInclusive) to theNumberInputConfigclass, which control the minimum and maximum allowed values in number input fields.createNumberInputQuestionfunction to handle these new options.QuestionNumberFormcomponent to include new form fields for the new options, complete with validation logic.How Has This Been Tested?
Fixes Jira Issue
https://jira.ess.eu//browse/
Depends On
Tests included/Docs Updated?