Skip to content

Commit 0ec2d0c

Browse files
committed
fix: make name, classNamePrefix fallback to inputId
1 parent 15450b6 commit 0ec2d0c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Shared/Components/SelectPicker/SelectPicker.component.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ const SelectPicker = ({
125125
disableDescriptionEllipsis = false,
126126
multiSelectProps = {},
127127
isMulti,
128+
name,
129+
classNamePrefix,
128130
...props
129131
}: SelectPickerProps) => {
130132
const { inputId, required, isDisabled, controlShouldRenderValue } = props
@@ -224,6 +226,8 @@ const SelectPicker = ({
224226
<CreatableSelect<SelectPickerOptionType, true>
225227
{...props}
226228
isMulti
229+
name={name || inputId}
230+
classNamePrefix={classNamePrefix || inputId}
227231
placeholder={placeholder}
228232
components={{
229233
IndicatorSeparator: null,
@@ -254,6 +258,8 @@ const SelectPicker = ({
254258
) : (
255259
<ReactSelect<SelectPickerOptionType, false>
256260
{...props}
261+
name={name || inputId}
262+
classNamePrefix={classNamePrefix || inputId}
257263
placeholder={placeholder}
258264
components={{
259265
IndicatorSeparator: null,

src/Shared/Components/SelectPicker/type.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ type SelectProps = ReactSelectProps<SelectPickerOptionType>
2727

2828
export type SelectPickerProps = Pick<
2929
SelectProps,
30+
| 'name'
31+
| 'classNamePrefix'
3032
| 'options'
3133
| 'value'
3234
| 'onChange'
@@ -45,7 +47,7 @@ export type SelectPickerProps = Pick<
4547
| 'getOptionValue'
4648
| 'isOptionSelected'
4749
> &
48-
Required<Pick<SelectProps, 'classNamePrefix' | 'inputId' | 'name'>> & {
50+
Required<Pick<SelectProps, 'inputId'>> & {
4951
/**
5052
* Icon to be rendered in the control
5153
*/

0 commit comments

Comments
 (0)