Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

interact button reacting twice

I'm trying to update some old interact to the new Jupyter notebook. I'd like to have an interact with buttons, something like the following:

act = []
@interact
def play(move=selector([None] + ["Auto", "Reset"], buttons=True)):
      act.append(move)
      print(act)

However when I press a new button, the applet receive it twice. For example, if I press "Auto" and the "Reset" it prints

[None, 'Auto', 'Auto', 'Reset', 'Reset']

instead of

[None, 'Auto', 'Reset']

Is it expected ?