Skip to content

Commit d086baf

Browse files
author
Céline Gilet
committed
fix(SelectNext): No generation of aria-describedby referencing a non-existent id in the case of a default state(#402)
1 parent deb4b33 commit d086baf

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)