Extra stHidden in the streamlit html


I use css to inject into the streamlit html so I can change color/size/position of the streamlit components. However, I always notice that there is an extra stHidden element in the generated html; when I click one of the buttons on the page, an extra stHidden element would be gone and only left with one stHidden element.
In the css stylesheet, I need to manually copy each UI element’s selector path, thus this change of stHidden element messes up my UI. Does anyone know why this happens? How can I just remove the stHidden from my streamlit html?

Debug info

  • Streamlit version: 1.15.2
  • Python version: python 3.8.12
  • Using Conda
  • OS version: Ubuntu 20
  • Browser version: Chrome

CSS styling in Streamlit is not trivial for sure. I’m not sure which components you’re working with, but I doubt you will be able to remove those divs from the backend. Can you share more about what styling you are trying to accomplish that is giving you trouble?

Hi @mathcatsand , yea I later kinda fix this and get some clue of why the stHidden shows up. It is because I was manipulating the st.session_state at that moment. When I move the st.session_state calculation to elsewhere, I see no more stHidden.

1 Like