Balloons inside st.dialog is Offset

When running st.balloons() inside st.dialog(), the balloons are offset by half the page?

Sample code:

import streamlit as st 

# st.balloons() ## This is fine

@st.dialog("Surprise!")
def show_dialog():
    st.write("Some balloons")
    st.balloons() ## This is offset by half the page

if st.button("Click for a surprise"):
    # st.balloons() ## This is also fine, but will be hidden behind the dialog
    show_dialog()

Details:
Runnning on Windows
Python 3.10
Streamlit version 1.37.0

Hi @yewey2 :wave:

This appears to be a bug! Thanks for calling it out :balloon: It also affects st.snow()

I’ve filed a bug report. Please upvote it to help the team prioritize the fix: st.balloons/snow appear only on right half of page when called within a dialog · Issue #9236 · streamlit/streamlit · GitHub

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.