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

st.map is narrow inside expander unless another map is added #8004

Open
3 of 4 tasks
blackary opened this issue Jan 23, 2024 · 2 comments
Open
3 of 4 tasks

st.map is narrow inside expander unless another map is added #8004

blackary opened this issue Jan 23, 2024 · 2 comments
Assignees
Labels
feature:st.map priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@blackary
Copy link
Collaborator

blackary commented Jan 23, 2024

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

If I add a map inside an expander, it is fairly narrow. If I add a second map and refresh the page, it expands to the full container width.

Reproducible Code Example

Open in Streamlit Cloud

import streamlit as st
import pandas as pd

d = {"lat": [40.781243], "lon": [-73.968432]}

df = pd.DataFrame.from_dict(d)

with st.expander("map"):
    st.map(df, size=2)

if st.checkbox("Add extra map"):
    st.map(df, size=2)

Steps To Reproduce

Expand the expander, and note that the map is narrow
image

Click the checkbox to show another map
image

Hit r to refresh the app
image

Expected Behavior

The app should be full width

Current Behavior

No response

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.30.0
  • Python version: 3.10.3
  • Operating System: Mac OS
  • Browser: Chrome

Additional Information

Reported on https://discuss.streamlit.io/t/st-map-does-not-display-properly-inside-expander/60316?u=blackary

@blackary blackary added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Jan 23, 2024
Copy link

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@LukasMasuch LukasMasuch added status:confirmed Bug has been confirmed by the Streamlit team priority:P2 feature:st.map and removed status:needs-triage Has not been triaged by the Streamlit team labels Jan 23, 2024
@LukasMasuch
Copy link
Collaborator

@blackary Thanks for reporting this issue. I reproduced this here. Even if use_container_width=True is set, it's not using the full available size. Seems like a bug or even a regression (related to #7113 / #7307).

image

@LukasMasuch LukasMasuch changed the title st.map is narrowr inside expander unless another map is added st.map is narrow inside expander unless another map is added Jan 23, 2024
@sfc-gh-wihuang sfc-gh-wihuang self-assigned this Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.map priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants