Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use key to force update when dynamic properties are changed #49

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

blackary
Copy link
Owner

@blackary blackary commented Jan 2, 2025

As reported here https://discuss.streamlit.io/t/new-component-streamlit-keyup-a-textbox-that-returns-the-text-as-you-type/29860/9?u=blackary, changing the arguments to st_keyup doesn't actually affect the widget, except for the initial values passed when the widget is created.

This is rather ironic, given the purpose of this widget is to make a more dynamic version of st.text_input :)

This fixes this by making the key that is passed to the component depend on those arguments, so that if you pass a new value, the widget gets re-rendered with those new arguments.

@blackary blackary merged commit 3e27851 into main Jan 2, 2025
1 check passed
@blackary blackary deleted the fix-dynamic-properties branch January 2, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant