modal won't display twice in a row

Greetings, noob here, with noob questions.

What is the correct way to get a modal to display twice in a row?

This seems to be a known issue, but I’m finding antiquated answers on the search engines (like referencing panel.io.schedule_task which doesn’t exist anymore).

The symptom is, the modal won’t display twice in a row. However if I show any other modal afterwards, it comes back.

My code is vanilla:

on_cancel():
modal.hide()

button with bind to show modal

button_to_show_modal():
modal.show()

When I press the Show button, the modal displays. When I press the Cancel button (inside the modal) it goes away. All good.

But when I press the Show button again, nothing happens, and the callback never gets called. The search engines say it has something to do with forcing a reset of the modal state, but I’m not sure how to do that. I tried a couple of their methods without luck.

On a more advanced note, how does one go about debugging issues like this? Pdb?

Try using panel-material-ui Dialog — Panel Material UI v0.11.0