m-wrzr / streamlit-searchbox

Streamlit searchbox that dynamically updates and provides a list of suggestions based on a provided function
MIT License
201 stars 26 forks source link

searchbox options move other elements around (not positioned absolutely) #46

Open JoshElgar opened 1 month ago

JoshElgar commented 1 month ago

temporary workaround:

    css = """
    iframe[title="streamlit_searchbox.searchbox"] {
        position: absolute;
        z-index: 10;
    }
    """
    st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
m-wrzr commented 3 days ago

Thanks for providing the workaround, I've added added a new flag in 0.1.13 and listed you as a contributer.

This is afaik the only way to position it absolutely since the iFrame itself can't escape its bounds. It's still a bit problematic, since this will always apply to all searchboxes (and the searchboxes need some additional blocks to reserve space), but I guess there is also no other way of targeting.