[autocomplete][docs] Improve Google Maps search example#44708
Merged
oliviertassinari merged 3 commits intomui:masterfrom Feb 4, 2025
Merged
[autocomplete][docs] Improve Google Maps search example#44708oliviertassinari merged 3 commits intomui:masterfrom
oliviertassinari merged 3 commits intomui:masterfrom
Conversation
Netlify deploy previewBundle size report |
f979f97 to
2d1b3f0
Compare
oliviertassinari
commented
Dec 9, 2024
| @@ -1,10 +1,7 @@ | |||
| export default function loadScript(src: string, position: HTMLElement | null) { | |||
| export default function loadScript(src: string, position: HTMLElement) { | |||
Member
Author
There was a problem hiding this comment.
Code style, no defensive logic in places where it's not their business logic to have.
| ); | ||
| return ( | ||
| <li key={key} {...optionProps}> | ||
| <Grid container sx={{ alignItems: 'center' }}> |
Member
Author
There was a problem hiding this comment.
Migrate to Grid2, one more. We should really migrate the whole codebase.
Comment on lines
-159
to
+246
| sx={{ fontWeight: part.highlight ? 'bold' : 'regular' }} | ||
| sx={{ | ||
| fontWeight: part.highlight | ||
| ? 'fontWeightBold' | ||
| : 'fontWeightRegular', | ||
| }} |
Member
Author
There was a problem hiding this comment.
Rely on the design token, not hard-coded values.
| import Typography from '@mui/material/Typography'; | ||
| import parse from 'autosuggest-highlight/parse'; | ||
| import { debounce } from '@mui/material/utils'; | ||
| import throttle from 'lodash/throttle'; |
Member
Author
There was a problem hiding this comment.
Trying to go back to a better UX after #35545.
2d1b3f0 to
5ce77c0
Compare
1 task
a8217e4 to
eb0e126
Compare
eb0e126 to
adc3265
Compare
oliviertassinari
added a commit
that referenced
this pull request
Feb 4, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Preview: https://deploy-preview-44708--material-ui.netlify.app/material-ui/react-autocomplete/#google-maps-place
Initially, I thought I could quickly handle https://developers.google.com/maps/documentation/javascript/places-migration-autocomplete. It was much harder than expected 😅
I have tried to make the demo crash, like in #35391 but couldn't find a way.
We can use https://console.cloud.google.com/google/maps-apis/metrics?hl=en&inv=1&invt=Abjs3A&project=material-ui-docs to keep track of the API usage, make sure it's still OK.
As for why work on this, see https://github.com/NiazMorshed2007/shadcn-address-autocomplete/, unless the community builds this, we need to stay up to date to stay relevant.
Side note, we are supposed to give logo attribution: https://developers.google.com/maps/documentation/javascript/policies#logo
e.g. https://developers.google.com/maps/documentation/javascript/place-autocomplete-new