Open quying opened 2 months ago
I get an error as well - TypeError: ButtonsItem.init() got an unexpected keyword argument 'on_change'
# Function to add a new tab
def add_tab():
st.session_state.num_tabs += 1
# Function to remove a tab
def remove_tab():
if st.session_state.num_tabs > 1:
st.session_state.num_tabs -= 1
sac.buttons([
sac.ButtonsItem(label="Add Tab", on_change=add_tab),
sac.ButtonsItem(label="Remove Tab", on_change=remove_tab, disabled=st.session_state.num_tabs == 1),
],
)
Name: streamlit Version: 1.38.0
Name: streamlit-antd-components Version: 0.3.2
sac.buttons callback args is still broken.
def callback(*args, **kwargs):
print(f"callback args: {args}")
def test():
key = uri + f"_{name}_buttons"
print(f"key: {key}")
sac.buttons(
[sac.ButtonsItem(uri) for uri in uris],
index=None,
size='xs',
key=key,
on_change=callback, args=(key,)
)
The above code is broken with an upgrade if streamlit1.36.0, the callback args print out empty tuple: ()
When I set on_change callback, it's not called.
Streamlit==1.36.0 streamlit_antd_components==0.3.2