streamlit-javascript icon indicating copy to clipboard operation
streamlit-javascript copied to clipboard

added whitespace when st_javascript is being called

Open vincent-larisma opened this issue 1 year ago • 1 comments

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

vincent-larisma avatar Jul 13 '23 13:07 vincent-larisma

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.

binste avatar Jul 14 '23 12:07 binste