Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mui: override autocomplete style #241

Merged
merged 1 commit into from Mar 5, 2024
Merged

mui: override autocomplete style #241

merged 1 commit into from Mar 5, 2024

Conversation

ddecrulle
Copy link
Collaborator

Change the global style for mui autocomplete
With this code

<MuiDsfrThemeProvider>
            <Autocomplete
                disablePortal
                id="combo-box-demo"
                options={communes}
                sx={{ width: 300 }}
                renderInput={params => <TextField {...params} label="Commencez votre saisie" />}
            />

            <Autocomplete
                disablePortal
                id="combo-box-demo"
                options={communes}
                sx={{ width: 300 }}
                renderInput={({ InputProps, disabled, id, inputProps }) => (
                    <Input
                        ref={InputProps.ref}
                        label="Le label du champ"
                        id={id}
                        disabled={disabled}
                        nativeInputProps={{ ...inputProps, placeholder: "Commencez votre saisie" }}
                    />
                )}
            />
        </MuiDsfrThemeProvider>

Before :
Capture d’écran 2024-03-05 à 17 11 16
Capture d’écran 2024-03-05 à 17 11 29

After :
Capture d’écran 2024-03-05 à 17 03 09
Capture d’écran 2024-03-05 à 17 03 29

@ddecrulle ddecrulle requested a review from garronej March 5, 2024 16:31
@garronej
Copy link
Collaborator

garronej commented Mar 5, 2024

Magnifique ça tue!

@garronej garronej merged commit fad798b into main Mar 5, 2024
6 checks passed
@garronej garronej deleted the mui-autocomplete branch March 5, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants