Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit affa385

Browse files
committed
fix: delete duration
1 parent ebcf6a1 commit affa385

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/FormField/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const FormField = ({ field, isGroupField }) => {
4646
<TextInput
4747
placeholder={field.placeholder}
4848
value={input?.value ?? ""}
49+
isRequired={field.isRequired}
4950
type="number"
5051
minValue={field.minValue}
5152
onChange={input.onChange}

src/components/TextInput/index.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ function TextInput(props) {
2020
if (event.target.value >= props.minValue) {
2121
props.onChange(event.target.value);
2222
} else {
23-
props.onChange(props.minValue);
23+
if (props.isRequired) {
24+
props.onChange(props.minValue);
25+
} else {
26+
// can delete the number
27+
props.onChange("");
28+
}
2429
}
2530
} else {
2631
props.onChange(event.target.value);

0 commit comments

Comments
 (0)