codegouvfr / react-dsfr

🇫🇷 The French Government Design system React toolkit
https://react-dsfr.codegouv.studio
MIT License
406 stars 51 forks source link

Select id native props 2 #213

Closed Thorekt closed 8 months ago

Thorekt commented 8 months ago

Hi,

After the correction in #212 the bug seems still here, i saw your modification but it's override by the "selectId" comming after

const id = useAnalyticsId({
    "defaultIdPrefix": "fr-select-group",
    "explicitlyProvidedId": id_props ?? nativeSelectProps.id
});

const selectId = `select-${useId()}`;

the select element use "selectId" :

<select
    {...nativeSelectProps}
    className={cx(fr.cx("fr-select"), nativeSelectProps.className)}
    id={selectId}
    aria-describedby={stateDescriptionId}
    disabled={disabled}
>    
   {children}
</select>

I think the id in "nativeSelectProps" is overide by the id using "selectId"

Thanx for your reactivity

garronej commented 8 months ago

Ah yeah, sure sorry about that.

garronej commented 8 months ago

Fixed for good this time, thanks for reporting.