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 #24

Open
amirmk89 opened this issue Jan 12, 2023 · 1 comment
Open

Tracking buttons with the same name #24

amirmk89 opened this issue Jan 12, 2023 · 1 comment

Comments

@amirmk89
Copy link

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!

@nathanjones4323
Copy link

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.

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

No branches or pull requests

2 participants