-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[material-ui][Autocomplete] Improve design when there's a start adornment for small autocomplete #41781
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
Merged
ZeeshanTamboli
merged 35 commits into
mui:next
from
TahaRhidouani:autocomplete-startadornment-patch
May 9, 2024
Merged
[material-ui][Autocomplete] Improve design when there's a start adornment for small autocomplete #41781
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
28ea5aa
Bump vite to 3.2.10 [SECURITY] (#41761)
renovate[bot] 6d0f4f2
[blog] Fix typo in MUI X v7 announcement post (#41773)
levigunz 4d99e04
[core] Remove Base UI mentions from issues templates (#41733)
danilo-leal d6b1f64
[pigment-css][docs] Fix git diff formatting
oliviertassinari fc623b4
[base-ui][website] Page <title> should have no dots
oliviertassinari f5a40ab
[docs] Drop IE 11 official support (#41611)
iammminzzy 9cc4984
6.0.0-alpha.1 (#41749)
siriwatknp dd0b68f
[material-ui][Autocomplete] Prevent start adornment from causing inpu…
TahaRhidouani 2ed5db5
[material-ui][Autocomplete] Prevent start adornment from causing inpu…
TahaRhidouani d7f518b
[material-ui][Autocomplete] Fix build
TahaRhidouani 6265175
[material-ui][Autocomplete] Fix build
TahaRhidouani 95ddaf8
[material-ui][Autocomplete] Fix use case for multiple
TahaRhidouani 59c9214
Merge branch 'autocomplete-startadornment-patch' of github.com:TahaRh…
TahaRhidouani 958eab1
[material-ui][Autocomplete] Fix flicker due to hover state
TahaRhidouani 2c4402f
[material-ui][Autocomplete] Fix focused logic & add tests
TahaRhidouani fbfff90
[material-ui][Autocomplete] Prettify code
TahaRhidouani 09d1210
Merge branch 'next' into autocomplete-startadornment-patch
ZeeshanTamboli 4ac0187
[material-ui][Autocomplete] address PR comments
TahaRhidouani 4df7fb5
[material-ui][Autocomplete] forgot to regenerate docs
TahaRhidouani 468ddb8
[material-ui][Autocomplete] undo vs code import reorg & remove unnece…
TahaRhidouani 39e6635
Merge branch 'next' of github.com:TahaRhidouani/material-ui into auto…
TahaRhidouani 1bc732e
[material-ui][Autocomplete] address PR comments & add test
TahaRhidouani b886b6a
[material-ui][Autocomplete] tweaks to the test
TahaRhidouani db62d3b
Merge branch 'next' into autocomplete-startadornment-patch
ZeeshanTamboli 6c105d3
Merge branch 'autocomplete-startadornment-patch' of https://github.co…
ZeeshanTamboli 9ff8ee0
prettier
ZeeshanTamboli 20c213b
tweak test
ZeeshanTamboli b7dbce0
Merge branch 'next' into autocomplete-startadornment-patch
ZeeshanTamboli 71c4d33
Merge branch 'next' into autocomplete-startadornment-patch
ZeeshanTamboli ea24fe2
remove multiple
ZeeshanTamboli dc9a257
add visual regression test
ZeeshanTamboli c8fb9dc
remove diff
ZeeshanTamboli 1eb8a3d
prettier
ZeeshanTamboli 881ce56
Merge branch 'next' into autocomplete-startadornment-patch
ZeeshanTamboli b958bea
remove unnecessary props from Autocomplete in the visual regression test
ZeeshanTamboli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
test/regressions/fixtures/Autocomplete/SmallAutocompleteWithStartAdornment.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import * as React from 'react'; | ||
| import Autocomplete from '@mui/material/Autocomplete'; | ||
| import SvgIcon from '@mui/material/SvgIcon'; | ||
| import TextField from '@mui/material/TextField'; | ||
|
|
||
| const movies = [ | ||
| { | ||
| label: 'The Lord of the Rings: The Two Towers', | ||
| year: 2002, | ||
| }, | ||
| ]; | ||
|
|
||
| export default function SmallAutocompleteWithStartAdornment() { | ||
| return ( | ||
| <Autocomplete | ||
| options={movies} | ||
| value={movies[0]} | ||
| sx={{ width: 120, mt: 2 }} | ||
| renderInput={(params) => ( | ||
| <TextField | ||
| {...params} | ||
| label="Autocomplete" | ||
| InputProps={{ | ||
| ...params.InputProps, | ||
| startAdornment: ( | ||
| <SvgIcon> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| fill="none" | ||
| viewBox="0 0 24 24" | ||
| strokeWidth={1.5} | ||
| stroke="currentColor" | ||
| > | ||
| <path | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| d="M4.5 12a7.5 7.5 0 0015 0m-15 0a7.5 7.5 0 1115 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077l1.41-.513m14.095-5.13l1.41-.513M5.106 17.785l1.15-.964m11.49-9.642l1.149-.964M7.501 19.795l.75-1.3m7.5-12.99l.75-1.3m-6.063 16.658l.26-1.477m2.605-14.772l.26-1.477m0 17.726l-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205L12 12m6.894 5.785l-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864l-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495" | ||
| /> | ||
| </svg> | ||
| </SvgIcon> | ||
| ), | ||
| }} | ||
| /> | ||
| )} | ||
| /> | ||
| ); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.