Skip to content

Commit 896364e

Browse files
authored
Merge pull request #468 from mashmatrix/support-slds-2-select
Update `Select` for SLDS2
2 parents b513781 + a32dd17 commit 896364e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/scripts/Select.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ export const Select = createFC<SelectProps, { isFormElement: boolean }>(
6969
{children}
7070
</select>
7171
);
72+
const selectElemWithContainer = rprops.multiple ? (
73+
selectElem
74+
) : (
75+
<div className='slds-select_container'>{selectElem}</div>
76+
);
7277
if (isFieldSetColumn || label || required || error || cols) {
7378
const formElemProps = {
74-
id,
79+
controlId: id,
7580
label,
7681
required,
7782
error,
@@ -80,9 +85,11 @@ export const Select = createFC<SelectProps, { isFormElement: boolean }>(
8085
tooltipIcon,
8186
elementRef,
8287
};
83-
return <FormElement {...formElemProps}>{selectElem}</FormElement>;
88+
return (
89+
<FormElement {...formElemProps}>{selectElemWithContainer}</FormElement>
90+
);
8491
}
85-
return selectElem;
92+
return selectElemWithContainer;
8693
},
8794
{ isFormElement: true }
8895
);

0 commit comments

Comments
 (0)