Skip to content

Commit b97bc23

Browse files
authored
Merge pull request #404 from celinegilet/main
fix(SelectNext): No generation of aria-describedby referencing a non-existant id in the case of a default state (#402)
2 parents deb4b33 + d086baf commit b97bc23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SelectNext.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,11 @@ function NonMemoizedNonForwardedSelect<T extends SelectProps.Option[]>(
174174
className={cx(fr.cx("fr-select"), nativeSelectProps.className)}
175175
id={selectId}
176176
aria-describedby={
177-
nativeSelectProps["aria-describedby"] !== undefined
177+
state !== "default" && nativeSelectProps["aria-describedby"] !== undefined
178178
? `${stateDescriptionId} ${nativeSelectProps["aria-describedby"]}`
179-
: stateDescriptionId
179+
: state !== "default"
180+
? stateDescriptionId
181+
: undefined
180182
}
181183
disabled={disabled}
182184
>

0 commit comments

Comments
 (0)