@@ -14,6 +14,7 @@ import {
1414 FocusEvent ,
1515 forwardRef ,
1616 HTMLInputTypeAttribute ,
17+ InputHTMLAttributes ,
1718 ReactElement ,
1819 RefObject ,
1920 useMemo ,
@@ -135,7 +136,13 @@ export const GenericTextField = forwardRef(
135136 } ;
136137 fieldOptions = {
137138 ...fieldOptions ,
138- inputProps : { ...fieldOptions ?. inputProps , inputMode : "numeric" } ,
139+ slotProps : {
140+ ...fieldOptions ?. slotProps ,
141+ htmlInput : {
142+ ...fieldOptions ?. slotProps ?. htmlInput ,
143+ inputMode : "numeric" ,
144+ } ,
145+ } ,
139146 } ;
140147 }
141148
@@ -163,6 +170,13 @@ export const GenericTextField = forwardRef(
163170 } ;
164171
165172 const error = props . error ?? isFormFieldInvalid ;
173+ const fieldSlotProps = fieldOptions ?. slotProps as
174+ | {
175+ htmlInput ?: InputHTMLAttributes < HTMLInputElement > ;
176+ input ?: Partial < OutlinedInputProps > ;
177+ }
178+ | undefined ;
179+
166180 return (
167181 < div className = { `${ widthStyling } ${ props . className ?? "" } ${ error ? "error" : "" } ` } >
168182 < TextField
@@ -179,26 +193,30 @@ export const GenericTextField = forwardRef(
179193 disabled = { props . disabled }
180194 { ...fieldOptions }
181195 sx = { { width : 1 , ...fieldOptions ?. sx } }
182- inputProps = { {
183- readOnly : props . readOnly ,
184- "aria-readonly" : props . readOnly ,
185- className : `${ props . readOnly ? "bg-base-lightest" : "" } ` ,
186- ...fieldOptions ?. inputProps ,
187- "aria-label" : props . ariaLabel ?? camelCaseToSentence ( props . fieldName ) ,
188- tabIndex : 0 ,
189- } }
190- InputProps = { {
191- readOnly : props . readOnly ,
192- "aria-readonly" : props . readOnly ,
193- className : `${ props . readOnly ? "bg-base-lightest" : "" } ` ,
194- ...props . inputProps ,
195- } }
196196 required = { props . required }
197197 type = { props . type }
198198 onFocus = { props . onFocus }
199199 onKeyDown = { props . onKeyDown }
200+ slotProps = { {
201+ ...fieldSlotProps ,
202+ input : {
203+ ...fieldSlotProps ?. input ,
204+ readOnly : props . readOnly ,
205+ "aria-readonly" : props . readOnly ,
206+ className : `${ props . readOnly ? "bg-base-lightest" : "" } ` ,
207+ ...props . inputProps ,
208+ } ,
209+
210+ htmlInput : {
211+ ...fieldSlotProps ?. htmlInput ,
212+ readOnly : props . readOnly ,
213+ "aria-readonly" : props . readOnly ,
214+ className : `${ props . readOnly ? "bg-base-lightest" : "" } ` ,
215+ "aria-label" : props . ariaLabel ?? camelCaseToSentence ( props . fieldName ) ,
216+ tabIndex : 0 ,
217+ } ,
218+ } }
200219 />
201-
202220 < div aria-live = "polite" className = "screen-reader-only" >
203221 { error && (
204222 < div > { `${
0 commit comments