nicedouble / StreamlitAntdComponents

A Streamlit component to display Antd-Design
https://nicedouble-streamlitantdcomponentsdemo-app-middmy.streamlit.app/
MIT License
442 stars 29 forks source link

Button not functioning correctly when using key #39

Closed AndresLopezE closed 10 months ago

AndresLopezE commented 10 months ago

When using sac.buttons without a key the component works just fine but if I add a key to that key = "keystring" if will start reloading the page multipletimes and resetting the component to its original state

this works :

sac.buttons(
            [
                sac.ButtonsItem(icon="dash-lg", color="#bfbfbf"),
                sac.ButtonsItem(icon="check-lg", color="#327f24"),
                sac.ButtonsItem(icon="question-lg", color="#fab64c"),
                sac.ButtonsItem(icon="arrow-clockwise", color="#c21020"),
            ],
            label=None,
            align="start",
            size="md",
            direction="horizontal",
            variant="outline",
            return_index=True,
        )

This doesn't:


sac.buttons(
            [
                sac.ButtonsItem(icon="dash-lg", color="#bfbfbf"),
                sac.ButtonsItem(icon="check-lg", color="#327f24"),
                sac.ButtonsItem(icon="question-lg", color="#fab64c"),
                sac.ButtonsItem(icon="arrow-clockwise", color="#c21020"),
            ],
            label=None,
            align="start",
            size="md",
            direction="horizontal",
            variant="outline",
            return_index=True,
            key="randomkey"
        )
nicedouble commented 10 months ago

hi,the issue has fixed in new version.