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

[Autocomplete] Built-in fullWidth #19805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/Asynchronous.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default function Asynchronous() {
<TextField
{...params}
label="Asynchronous"
fullWidth
variant="outlined"
InputProps={{
...params.InputProps,
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/Asynchronous.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default function Asynchronous() {
<TextField
{...params}
label="Asynchronous"
fullWidth
variant="outlined"
InputProps={{
...params.InputProps,
Expand Down
8 changes: 1 addition & 7 deletions docs/src/pages/components/autocomplete/CheckboxesTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ export default function CheckboxesTags() {
)}
style={{ width: 500 }}
renderInput={params => (
<TextField
{...params}
variant="outlined"
label="Checkboxes"
placeholder="Favorites"
fullWidth
/>
<TextField {...params} variant="outlined" label="Checkboxes" placeholder="Favorites" />
)}
/>
);
Expand Down
8 changes: 1 addition & 7 deletions docs/src/pages/components/autocomplete/CheckboxesTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ export default function CheckboxesTags() {
)}
style={{ width: 500 }}
renderInput={params => (
<TextField
{...params}
variant="outlined"
label="Checkboxes"
placeholder="Favorites"
fullWidth
/>
<TextField {...params} variant="outlined" label="Checkboxes" placeholder="Favorites" />
)}
/>
);
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function ComboBox() {
options={top100Films}
getOptionLabel={option => option.title}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Combo box" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Combo box" variant="outlined" />}
/>
);
}
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function ComboBox() {
options={top100Films}
getOptionLabel={option => option.title}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Combo box" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Combo box" variant="outlined" />}
/>
);
}
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/CountrySelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default function CountrySelect() {
{...params}
label="Choose a country"
variant="outlined"
fullWidth
inputProps={{
...params.inputProps,
autoComplete: 'new-password', // disable autocomplete and autofill
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/CountrySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default function CountrySelect() {
{...params}
label="Choose a country"
variant="outlined"
fullWidth
inputProps={{
...params.inputProps,
autoComplete: 'new-password', // disable autocomplete and autofill
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/DisabledOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function DisabledOptions() {
options={timeSlots}
getOptionDisabled={option => option === timeSlots[0] || option === timeSlots[2]}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Disabled options" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Disabled options" variant="outlined" />}
/>
);
}
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/DisabledOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function DisabledOptions() {
options={timeSlots}
getOptionDisabled={option => option === timeSlots[0] || option === timeSlots[2]}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Disabled options" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Disabled options" variant="outlined" />}
/>
);
}
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default function Filter() {
getOptionLabel={option => option.title}
filterOptions={filterOptions}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Custom filter" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Custom filter" variant="outlined" />}
/>
);
}
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default function Filter() {
getOptionLabel={option => option.title}
filterOptions={filterOptions}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="Custom filter" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="Custom filter" variant="outlined" />}
/>
);
}
Expand Down
8 changes: 1 addition & 7 deletions docs/src/pages/components/autocomplete/FixedTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ export default function FixedTags() {
}
style={{ width: 500 }}
renderInput={params => (
<TextField
{...params}
label="Fixed tag"
variant="outlined"
placeholder="Favorites"
fullWidth
/>
<TextField {...params} label="Fixed tag" variant="outlined" placeholder="Favorites" />
)}
/>
);
Expand Down
8 changes: 1 addition & 7 deletions docs/src/pages/components/autocomplete/FixedTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ export default function FixedTags() {
}
style={{ width: 500 }}
renderInput={params => (
<TextField
{...params}
label="Fixed tag"
variant="outlined"
placeholder="Favorites"
fullWidth
/>
<TextField {...params} label="Fixed tag" variant="outlined" placeholder="Favorites" />
)}
/>
);
Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/components/autocomplete/FreeSolo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function FreeSolo() {
freeSolo
options={top100Films.map(option => option.title)}
renderInput={params => (
<TextField {...params} label="freeSolo" margin="normal" variant="outlined" fullWidth />
<TextField {...params} label="freeSolo" margin="normal" variant="outlined" />
)}
/>
<Autocomplete
Expand All @@ -25,7 +25,6 @@ export default function FreeSolo() {
label="Search input"
margin="normal"
variant="outlined"
fullWidth
InputProps={{ ...params.InputProps, type: 'search' }}
/>
)}
Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/components/autocomplete/FreeSolo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function FreeSolo() {
freeSolo
options={top100Films.map(option => option.title)}
renderInput={params => (
<TextField {...params} label="freeSolo" margin="normal" variant="outlined" fullWidth />
<TextField {...params} label="freeSolo" margin="normal" variant="outlined" />
)}
/>
<Autocomplete
Expand All @@ -25,7 +25,6 @@ export default function FreeSolo() {
label="Search input"
margin="normal"
variant="outlined"
fullWidth
InputProps={{ ...params.InputProps, type: 'search' }}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function FreeSoloCreateOption() {
style={{ width: 300 }}
freeSolo
renderInput={params => (
<TextField {...params} label="Free solo with text demo" variant="outlined" fullWidth />
<TextField {...params} label="Free solo with text demo" variant="outlined" />
)}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function FreeSoloCreateOption() {
style={{ width: 300 }}
freeSolo
renderInput={params => (
<TextField {...params} label="Free solo with text demo" variant="outlined" fullWidth />
<TextField {...params} label="Free solo with text demo" variant="outlined" />
)}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function FreeSoloCreateOptionDialog() {
style={{ width: 300 }}
freeSolo
renderInput={params => (
<TextField {...params} label="Free solo dialog" variant="outlined" fullWidth />
<TextField {...params} label="Free solo dialog" variant="outlined" />
)}
/>
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
Expand All @@ -114,7 +114,6 @@ export default function FreeSoloCreateOptionDialog() {
onChange={event => setDialogValue({ ...dialogValue, title: event.target.value })}
label="title"
type="text"
fullWidth
/>
<TextField
margin="dense"
Expand All @@ -123,7 +122,6 @@ export default function FreeSoloCreateOptionDialog() {
onChange={event => setDialogValue({ ...dialogValue, year: event.target.value })}
label="year"
type="number"
fullWidth
/>
</DialogContent>
<DialogActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function FreeSoloCreateOptionDialog() {
style={{ width: 300 }}
freeSolo
renderInput={params => (
<TextField {...params} label="Free solo dialog" variant="outlined" fullWidth />
<TextField {...params} label="Free solo dialog" variant="outlined" />
)}
/>
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
Expand All @@ -111,7 +111,6 @@ export default function FreeSoloCreateOptionDialog() {
onChange={event => setDialogValue({ ...dialogValue, title: event.target.value })}
label="title"
type="text"
fullWidth
/>
<TextField
margin="dense"
Expand All @@ -120,7 +119,6 @@ export default function FreeSoloCreateOptionDialog() {
onChange={event => setDialogValue({ ...dialogValue, year: event.target.value })}
label="year"
type="number"
fullWidth
/>
</DialogContent>
<DialogActions>
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/GoogleMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export default function GoogleMaps() {
options={options}
autoComplete
includeInputInList
freeSolo
disableOpenOnFocus
renderInput={params => (
<TextField
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/components/autocomplete/GoogleMaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export default function GoogleMaps() {
options={options}
autoComplete
includeInputInList
freeSolo
disableOpenOnFocus
renderInput={params => (
<TextField
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/Grouped.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export default function Grouped() {
groupBy={option => option.firstLetter}
getOptionLabel={option => option.title}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="With categories" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="With categories" variant="outlined" />}
/>
);
}
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/components/autocomplete/Grouped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export default function Grouped() {
groupBy={option => option.firstLetter}
getOptionLabel={option => option.title}
style={{ width: 300 }}
renderInput={params => (
<TextField {...params} label="With categories" variant="outlined" fullWidth />
)}
renderInput={params => <TextField {...params} label="With categories" variant="outlined" />}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/autocomplete/Highlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Highlights() {
options={top100Films}
getOptionLabel={option => option.title}
renderInput={params => (
<TextField {...params} label="Highlights" variant="outlined" fullWidth margin="normal" />
<TextField {...params} label="Highlights" variant="outlined" margin="normal" />
)}
renderOption={(option, { inputValue }) => {
const matches = match(option.title, inputValue);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/autocomplete/Highlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Highlights() {
options={top100Films}
getOptionLabel={option => option.title}
renderInput={params => (
<TextField {...params} label="Highlights" variant="outlined" fullWidth margin="normal" />
<TextField {...params} label="Highlights" variant="outlined" margin="normal" />
)}
renderOption={(option, { inputValue }) => {
const matches = match(option.title, inputValue);
Expand Down
Loading