File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
shiny/api-examples/remove_accordion_panel Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def make_panel(letter: str) -> ui.AccordionPanel:
2727
2828def server (input : Inputs , output : Outputs , session : Session ):
2929 # Copy the list for user
30- user_choices = list ( choices )
30+ user_choices = choices . copy ( )
3131
3232 @reactive .effect
3333 @reactive .event (input .remove_panel )
Original file line number Diff line number Diff line change 2020 f"Some narrative for section { letter } "
2121
2222
23- user_choices = list (choices )
24-
25-
2623@reactive .effect
2724@reactive .event (input .remove_panel )
2825def _ ():
29- if len (user_choices ) == 0 :
26+ if len (choices ) == 0 :
3027 ui .notification_show ("No more panels to remove!" )
3128 return
3229
33- ui .remove_accordion_panel ("acc" , f"Section { user_choices .pop ()} " )
30+ ui .remove_accordion_panel ("acc" , f"Section { choices .pop ()} " )
3431
3532 label = "No more panels to remove!"
36- if len (user_choices ) > 0 :
37- label = f"Remove Section { user_choices [- 1 ]} "
33+ if len (choices ) > 0 :
34+ label = f"Remove Section { choices [- 1 ]} "
3835 ui .update_action_button ("remove_panel" , label = label )
You can’t perform that action at this time.
0 commit comments