Continuous auto refresh of page with streamlit-drawable-canvas in latest versions of streamlit

Page keeps reloading automatically and randomly stops after 5-15 reloads whevenver st_canvas is called.

streamlit version: 1.25.0 (Tried 1.20.0, 1.23.0, 1.24.0 also does the same)
streamlit-drawable-canvas version - 0.9.0 (tried with 0.7.0, 0.9.2 and 0.9.3 also. same problem)

        image = pio.to_image(fig)
        img = Image.open(io.BytesIO(image))
        cols = st.columns([4,1])
        with cols[0]:
            tabs = st.tabs(['Plotly','Canvas'])
            with tabs[0]:
                plot_controls = st.container()
                with plot_controls:
                    # Add config to fig
                    config = ['drawline','drawopenpath','drawclosedpath','drawcircle','drawrect','eraseshape']
                    fig.update_layout(modebar_add=config,height = 800,width = 800)
                    st.plotly_chart(fig, use_container_width=True)    
                with tabs[1]:
                    st_canvas(background_image = img)
                    print('Canvas')
                    uploaded_image = st.file_uploader('Upload Image',type=['png','jpg','jpeg'],key='uploaded_image'+function_code)
1 Like

So, we have the same problem and it’s limit us with using streamlit.
Is there any workarounds or updates?