I would like to use a link_button instead of a button in my app but I want to capture if the link_button has been pressed and if so, execute some action.
The reason I need a link_button is because it does not force a rerun.
Basically I am asking of there is a way to “wrap” the link_button component and add basic functionality to return true or false if it has been clicked.
If I understand it correctly, the beauty of link_button is it doesn’t force a rerun.
I have a scenario where I have a series of buttons right now (st.button), each button’s label is a URL and if a button has been pressed, it opens a tab with the URL but also does something that is UI independent (send feedback to an S3 bucket on AWS). I want to do the same but with a link_button.
Currently, the rerun forced by st.button is destroying the layout of the container all these buttons are a part of. If I do the same container with link_button(s) - the layout is undisturbed because there is no rerun (is my understanding). However, with link_button I lose the ability to submit the feedback because I don’t know that a link_button has been clicked.
That’s kind of what I said, isn’t it? I am looking for a way to “enhance” link_button to return a true/false if it was clicked. Or are you saying as soon as there is “feedback” from a component - rerun is forced?
Is there a way to “attach” javascript functions to existing components “live” - components like link_button or do I need to write a whole new link_button implementation of my own?