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

Commit f6b734f

Browse files
committed
fix: step for duration only integers
- made the `step` configurable
1 parent 8db036e commit f6b734f

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

src/components/FormField/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const FormField = ({ field }) => {
5353
onBlur={input.onBlur}
5454
onFocus={input.onFocus}
5555
className={meta.error && meta.touched ? "error" : ""}
56+
step={field.step}
5657
/>
5758
)}
5859
{field.type === FORM_FIELD_TYPE.TEXTAREA && (

src/components/TCForm/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ TCForm.propTypes = {
119119
maxLength: PT.number,
120120
styleName: PT.string,
121121
readonly: PT.string,
122+
step: PT.number,
122123
})
123124
).isRequired,
124125
onSubmit: PT.func,

src/components/TextInput/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function TextInput(props) {
3737
readOnly={props.readonly ?? false}
3838
onBlur={props.onBlur}
3939
onFocus={props.onFocus}
40-
step={props.type === "number" ? ".01" : null}
40+
step={props.step}
4141
/>
4242
);
4343
}
@@ -47,6 +47,7 @@ TextInput.defaultProps = {
4747
maxLength: Number.MAX_VALUE,
4848
placeholder: "",
4949
minValue: 0,
50+
step: null,
5051
};
5152

5253
TextInput.propTypes = {

src/routes/JobForm/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const getEditJobConfig = (skillOptions, onSubmit) => {
8484
name: "duration",
8585
minValue: 1,
8686
placeholder: "Duration",
87+
step: 1,
8788
},
8889
{
8990
label: "Resource Type",

src/routes/ResourceBookingForm/utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ export const getEditResourceBookingConfig = (onSubmit) => {
3434
name: "customerRate",
3535
minValue: 0,
3636
placeholder: "Client Rate",
37+
step: 0.01,
3738
},
3839
{
3940
label: "Member Rate",
4041
type: FORM_FIELD_TYPE.NUMBER,
4142
name: "memberRate",
4243
minValue: 0,
4344
placeholder: "Member Rate",
45+
step: 0.01,
4446
},
4547
{
4648
label: "Start Date",

0 commit comments

Comments
 (0)