File tree Expand file tree Collapse file tree
src/frontend/src/pages/FinancePage/ReimbursementRequestForm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,14 +129,14 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
129129 < Controller
130130 name = { `reimbursementProducts.${ product . index } .name` }
131131 control = { control }
132- render = { ( { fieldState : { error } } ) => (
132+ render = { ( { field } ) => (
133133 < TextField
134- placeholder = "Description"
135- error = { ! ! error }
136- helperText = { error ? error . message : null }
137- variant = "outlined"
138- fullWidth
134+ { ...field }
135+ placeholder = { 'Description' }
139136 autoComplete = "off"
137+ variant = { 'outlined' }
138+ fullWidth
139+ error = { ! ! errors . reimbursementProducts ?. [ product . index ] ?. name }
140140 />
141141 ) }
142142 />
@@ -148,20 +148,19 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
148148 < Controller
149149 name = { `reimbursementProducts.${ product . index } .cost` }
150150 control = { control }
151- render = { ( { fieldState : { error } } ) => (
151+ render = { ( { field } ) => (
152152 < TextField
153- placeholder = "Cost"
153+ { ...field }
154+ placeholder = { 'Cost' }
155+ variant = { 'outlined' }
154156 type = "number"
155- InputLabelProps = { { shrink : true } }
157+ fullWidth
158+ autoComplete = "off"
156159 InputProps = { {
157160 startAdornment : < InputAdornment position = "start" > $</ InputAdornment >
158161 } }
159- error = { ! ! error }
160- helperText = { error ? error . message : null }
161- variant = "outlined"
162- fullWidth
163- autoComplete = "off"
164162 onBlur = { ( e ) => onCostBlurHandler ( parseFloat ( e . target . value ) , product . index ) }
163+ error = { ! ! errors . reimbursementProducts ?. [ product . index ] ?. cost }
165164 />
166165 ) }
167166 />
You can’t perform that action at this time.
0 commit comments