streamlit icon indicating copy to clipboard operation
streamlit copied to clipboard

st.balloons triggers too often

Open jrieke opened this issue 2 years ago • 4 comments

Summary

If an app uses st.balloons, the balloons sometimes go up even if they shouldn't.

Steps to reproduce

Code snippet:

import time
import streamlit as st

st.number_input("foo")
time.sleep(0.5)  # simulate a computation
if st.button("balloons"):
    st.balloons()
  1. Click on the button. Ballons go up, that's correct!
  2. Click on + or - of the number input. Balloons go up for a split second but are stopped. They shouldn't go up at all!

Not sure if this also happens for other widgets besides number_input.

Video:

https://user-images.githubusercontent.com/5103165/159024704-c5f7ecfa-f89a-47bc-a57b-0eb1e7760ccf.mp4

Is this a regression?

That is, did this use to work the way you expected in the past? Idk

Debug info

  • Streamlit version: 1.7.0
  • Python version: 3.8
  • Using Conda? PipEnv? PyEnv? Pex? Pipenv
  • OS version:
  • Browser version: Chrome 99.0.4844.74

Additional information

If needed, add any other context about the problem here. For example, did this bug come from https://discuss.streamlit.io or another site? Link the original source here!

jrieke avatar Mar 18 '22 14:03 jrieke

It seems to be the same bug for me:

https://user-images.githubusercontent.com/25541767/172182002-2b95f1a1-c084-4792-8d92-cdedf42cf2b9.mp4

Code: https://github.com/PlatonB/high-perf-bio/blob/master/_gui_streamlit.py

PlatonB avatar Jun 06 '22 14:06 PlatonB

I had exactly the same issue with Streamlit 1.11.1, but it is gone with Streamlit 1.12.0

uyjco0 avatar Aug 15 '22 18:08 uyjco0

I am also facing this issue. Clicking on checkbox or slider input widgets also triggers the balloons which should only be triggered at the press of a button

My streamlit version is 1.12.0

manassharma07 avatar Aug 16 '22 19:08 manassharma07

Unfortunately, in 1.12.2 the issue remains.

@uyjco0 I guess you couldn't reproduce the problem because of the very short time of processing your data.

PlatonB avatar Aug 30 '22 14:08 PlatonB