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

added whitespace when st_javascript is being called #11

Open
vincent-larisma opened this issue Jul 13, 2023 · 1 comment
Open

added whitespace when st_javascript is being called #11

vincent-larisma opened this issue Jul 13, 2023 · 1 comment

Comments

@vincent-larisma
Copy link

how do I fix this issue when my streamlit web app runs and the streamlit_javascript code runs in the background gives me white space i.e. it gives additional space when called. I use streamlit_javascript for local storage

@binste
Copy link

binste commented Jul 14, 2023

For me the following worked:

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

It selects all ._element-container which have an iframe child with a title attribute set to "streamlit_javascript.streamlit_javascript". I don't know how well this works with older browsers and how reliable the title attribute is but hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants