Skip to content

Commit

Permalink
fix: set max value to age and height input
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Dec 23, 2024
1 parent 46a24a2 commit 4a4cdc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/processes/ideal_partner/AgeForm/AgeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const AgeForm = () => {
const value = Number(e.target.value);
if (value <= 0 || isNaN(value)) {
setMin(undefined);
} else if (value >= 100) {
setMin(100);
} else {
setMin(Number(e.target.value));
}
Expand All @@ -27,6 +29,8 @@ export const AgeForm = () => {
const value = Number(e.target.value);
if (value <= 0 || isNaN(value)) {
setMax(undefined);
} else if (value >= 100) {
setMax(100);
} else {
setMax(Number(e.target.value));
}
Expand All @@ -51,6 +55,7 @@ export const AgeForm = () => {
value={min ?? ''}
onChange={onChangeMin}
inputMode={'numeric'}
max={100}
/>
<span>-</span>
<Input
Expand All @@ -59,6 +64,7 @@ export const AgeForm = () => {
value={max ?? ''}
onChange={onChangeMax}
inputMode={'numeric'}
max={100}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const HeightStyleForm = () => {
const value = Number(e.target.value);
if (value <= 0 || isNaN(value)) {
setMin(undefined);
} else if (value >= 240) {
setMin(240);
} else {
setMin(value);
}
Expand All @@ -37,6 +39,8 @@ export const HeightStyleForm = () => {
const value = Number(e.target.value);
if (value <= 0 || isNaN(value)) {
setMax(undefined);
} else if (value >= 240) {
setMax(240);
} else {
setMax(value);
}
Expand Down

0 comments on commit 4a4cdc5

Please sign in to comment.