-
Notifications
You must be signed in to change notification settings - Fork 11
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
triggering the js_eval resets the page #2
Comments
Hi. I will work on it as soon as I find some time. I hope we can find a fix :) |
Hi. Sorry for the delay. I'm failing to get your example to work, and I'm kin of blocked as I'm not an expert (or knowledgeable at all!) of Streamlit internals :( Is it impossible/unfeasible to call |
No I can't call it outside the condition branch. I went and upvoted the issue you linked here. |
Hi, I am facing similar problem even outside the callback. The problem is when i do streamlit_js_eval(js_expression='window.innerwidth', key='WIDTH') it causes refresh. streamlit 1.30.0 and js_eval ver 1.5. |
Hi. It's x = streamlit_js_eval(js_expressions='window.innerWidth', key='WIDTH', want_output = True,)
st.write(f"Width is {x}") |
Hi. I just noticed that your code actually works if you replace Streamlit 1.31.0, Python 3.10 |
@derfryday @DevDrake Even more interestingly, if you create a simple HTML button using SJE itself and not the default Streamlit button, it works! There is a new version 0.1.7 now, with simple Bootstrap button I know this is really a workaround and not a real solution, but I'm not sure what else I can do without collaboration from the Streamlit team. |
Closing for now. Re-open if there is some other finding. |
Hello! I didn't quite understand how to use |
Just the exact same way you use normal Streamlit `st.button`
Dev-iL ***@***.***> schrieb am Mo., 10. Juni 2024, 13:09:
… Hello! I didn't quite understand how to use bootstrapButton. Could you
please provide a minimal example?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYCZ37Y4ULTCU33GA7HR7DZGWCNNAVCNFSM6AAAAABJCCMW3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJYGA2TANZZGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
What do you mean? It doesn't look like Did you mean that it can be replaced in the example code above, i.e. -if st.button("Test!"):
+if bootstrapButton("Test!"):
test_function: str = """ ? |
hello there,
I've run into an issue with the js_eval where it wouldn't properly render (or perhaps just reset the page?) when using it behind a button. It's the same whether or not I just put the code behind a
if button("Button Name"):
or when a callback method is used.Clicking the button multiple times results in the result of js_eval being shown.
Streamlit version: 1.11.1 (I can't go beyond that unfortunately)
streamlit_js_eval version: 0.1.5
example code:
example video of behaviour:
![bug_report](https://user-images.githubusercontent.com/84077730/208060047-0e83aa80-7b9b-4295-a6f1-bbcff93ef8b3.gif)
The text was updated successfully, but these errors were encountered: