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

Tracking buttons with the same name #26

Open
444B opened this issue Mar 2, 2024 · 2 comments
Open

Tracking buttons with the same name #26

444B opened this issue Mar 2, 2024 · 2 comments
Assignees
Labels
bug Something isn't working future release The issue will be fixed in a future release

Comments

@444B
Copy link
Owner

444B commented Mar 2, 2024

Original issue by amirmk89 on 2023-01-12 15:10:09+00:00

Hi, awesome tool!

I have a use case where several buttons have the same text, and currently the analytics tool tracks all of them as a single button. Each of the buttons has a unique key, and I thought it could be useful to support key based indexing instead of, e.g., button label based.
Is this possible in streamlit-analytics?

Thanks!

@444B
Copy link
Owner Author

444B commented Mar 2, 2024

Comment by nathanjones4323 on 2023-03-21 15:53:51+00:00

Same here

I believe the issue happens during the "monkey patching" of the widgets inside main.py
Here
&
Here
&
Here

The widget state/key gets set by default to the label of the widget during the "monkey patching", so even if you have a key set for the widget inside of your app, the state_dict used to track widget interaction will use the label of the widget.

Maybe you could move the "monkey patching" inside of your app page, but that seems messy. Ideally, we have the "monkey patched" widgets inside main.py inherit the key from the app file.

@444B
Copy link
Owner Author

444B commented Mar 2, 2024

@amirmk89 @nathanjones4323 is this still relevant?

@444B 444B self-assigned this Mar 2, 2024
@444B 444B added bug Something isn't working enhancement New feature or request labels Mar 3, 2024
@444B 444B added the future release The issue will be fixed in a future release label Mar 11, 2024
@444B 444B removed the enhancement New feature or request label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working future release The issue will be fixed in a future release
Projects
None yet
Development

No branches or pull requests

1 participant