File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
src/components/forms/ComboBox Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -219,3 +219,27 @@ export const CustomInputChangeHandler = (): JSX.Element => {
219
219
</ Form >
220
220
)
221
221
}
222
+
223
+ export const WithCustomInputClassNames = ( ) : JSX . Element => {
224
+ const fruitList = Object . entries ( fruits ) . map ( ( [ value , key ] ) => ( {
225
+ value : value ,
226
+ label : key ,
227
+ } ) )
228
+
229
+ return (
230
+ < Form onSubmit = { noop } >
231
+ < Label htmlFor = "fruit-custom-class" requiredMarker aria-required error >
232
+ Select a fruit
233
+ </ Label >
234
+ < ComboBox
235
+ id = "fruit-custom-class"
236
+ name = "fruit-custom-class"
237
+ options = { fruitList }
238
+ onChange = { noop }
239
+ inputProps = { {
240
+ className : 'usa-input--error' ,
241
+ } }
242
+ />
243
+ </ Form >
244
+ )
245
+ }
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ const Input = ({
77
77
< input
78
78
type = "text"
79
79
{ ...inputProps }
80
- className = " usa-combo-box__input"
80
+ className = { classnames ( ' usa-combo-box__input' , inputProps . className ) }
81
81
data-testid = "combo-box-input"
82
82
autoCapitalize = "off"
83
83
autoComplete = "off"
You can’t perform that action at this time.
0 commit comments