File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 207207
208208
209209"""
210+ import copy
210211import html
211212import io
212213import logging
@@ -670,6 +671,7 @@ def _format_button(buttons):
670671
671672 btns = []
672673 for btn in buttons :
674+ btn = copy .deepcopy (btn )
673675 if isinstance (btn , Mapping ):
674676 assert 'value' in btn and 'label' in btn , 'actions item must have value and label key'
675677 elif isinstance (btn , (list , tuple )):
@@ -763,10 +765,11 @@ def delete():
763765
764766 if isinstance (onclick , Sequence ):
765767 assert len (btns ) == len (onclick ), "`onclick` and `buttons` must be same length."
766- onclick = {btn ['value' ]: callback for btn , callback in zip (btns , onclick )}
768+ for idx , btn in enumerate (btns ):
769+ btn ['value' ] = idx
767770
768771 def click_callback (btn_val ):
769- if isinstance (onclick , dict ):
772+ if isinstance (onclick , Sequence ):
770773 return onclick [btn_val ]()
771774 else :
772775 return onclick (btn_val )
You can’t perform that action at this time.
0 commit comments