NathanChen198 / streamlit-cookies-controller

Control client browser cookie for the site.
MIT License
30 stars 1 forks source link

Strange whitespace when using cookie controller #8

Open anojangra opened 2 weeks ago

anojangra commented 2 weeks ago

There is a strange white space on the top of page when cookies are set. which disappears as soon as cookies are deleted. image

frankcorneliusmartin commented 1 week ago

I had the same issue. There seems to be a little bit of front-end code that shipped with the extension to solve this:

st.markdown(
    f"""
        <style>
            .element-container:has(iframe[height="0"]) {{ display: none; }}
        </style>
    """,
    unsafe_allow_html=True,
)

Not sure why it does not work? Maybe this fix broke with the update of streamlit. Anyway I added this to the bottom of my app.py as a workaround for now.