How to do nested button and print both button outputs?

That is a popular question! :smiley: Buttons don’t remember their state, so they will only be True immediately after being clicked (and hence a nested button with go away when clicked because the parent will go back to False). You can use session state and callback functions to extend the functionality.

I did a little introduction on extending widget functionality with session state here

Here’s a few cases other users have had with nested buttons (first link goes to my reply with sample code to show a basic case)

1 Like