Issue with Streamlit + Google Places Autocomplete — Address Not Capturing into Python Variables
Running locally
Hi everyone, I’m testing locally and running into an issue with my Streamlit app.
What I’m Trying to Do
I have a Google Places Autocomplete component (rendered inside components.html) that lets the user select an address. The UI renders properly and the autocomplete dropdown works, but:
When I click on an address, the selected street address and ZIP code are not getting passed back into my Python variables.
The UI shows the selection, but the Streamlit Python code never receives the values.
My goal is to capture the chosen address into Python variables (e.g. street_address, zipcode) and then use them in evaluations after clicking a Submit/Evaluate button.
Something in the components.html → Python bridge isn’t updating the variables when an address is picked.
What I’m Seeing
-
Autocomplete UI renders normally
-
Address selection shows visually in the front end
-
But no Python-side update happens
-
My downstream logic (including Google Maps, comps fetch, etc.) never gets the address
I suspect a Delta generator issue or a missing message callback between the component and Streamlit.
Environment
-
Running Locally
-
Streamlit version: 1.50.0
-
Python version: 3.12.10
-
OS: MacOS
-
Browser: Safari/ Chrome
What I’ve Tried So Far
-
Wrapped the component in
components.html(...)withheight=...andscrolling=False -
Tried sending data back to Streamlit via
window.parent.postMessage(...) -
Verified console shows the selected value
-
Confirmed that other components update normally
What I Want
I want to be able to:
-
Capture the selected address from the Google Places object
-
Parse street address and ZIP code
-
Store them into Python variables
-
Trigger the evaluation logic after clicking a button
Additional Notes
I think this may be a component messaging/delta problem — the values update visually in the component, but the Streamlit event loop never receives them.
Happy to share code snippets if helpful.