-
Notifications
You must be signed in to change notification settings - Fork 5
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
[BUG] Checkbox counts are incremented on startup #102
Comments
Thank you @robino16 for this issue! I will fix this and then also validate the startup/increment behavior of all widgets to ensure correct behavior |
Additionally, I am more than happy to accept a PR on this and add you as a collaborator to the project |
Initial findings:
Some of these makes sense since a default is being put as a value (such as st.color_picker) but where this behavior is not WAX is with What I believe is a suitable solution is to provide more granularity on the usage of st.checkbox and show how many times it was The other widget types I have looked into briefly and attempted some mitigations which did not work. Putting a placeholder for I think this is a pretty important finding, thank you @robino16 for raising! The deeper issue here is that the data tracked by certain widgets is not reliable and may not reflect actual widget usage but only page loads. |
Hi, @444B . I suspected that this issue could be present in more of the Streamlit components. Thank you for looking into it! The wrapper functions of I believe that the original author of How the counts should be measured are kind off a big question. Should the initial state increment the count? This means that the default states, like empty string " " for Here the default of So I think you're right about the I am not sure how to proceed from here. Implementing my code suggestion will change the behavior of |
Describe the bug
The counts for all checkboxes are incremented on startup without user interaction. Counts for checkboxes always start at one instead of zero and are incremented without interaction from the user.
Expected behavior
I would expect the counts for all widgets to start at zero the first time the app is run. Once a user checks or unchecks a checkbox, the count for that checkbox should increment by one. Checkboxes that are untouched should remain at count
0
.To Reproduce
Software Vesions
Additional context
The original
streamlit-analytics
repo by jrieke also has this bug.Suggested fix:
We should not increment the count the first time the script is run, only after a user has interacted with the checkbox. The following code attempts to solve this issue:
The code and comments here are just suggestions.
The text was updated successfully, but these errors were encountered: