File tree 2 files changed +5
-8
lines changed
shiny/api-examples/remove_accordion_panel
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:
27
27
28
28
def server (input : Inputs , output : Outputs , session : Session ):
29
29
# Copy the list for user
30
- user_choices = list ( choices )
30
+ user_choices = choices . copy ( )
31
31
32
32
@reactive .effect
33
33
@reactive .event (input .remove_panel )
Original file line number Diff line number Diff line change 20
20
f"Some narrative for section { letter } "
21
21
22
22
23
- user_choices = list (choices )
24
-
25
-
26
23
@reactive .effect
27
24
@reactive .event (input .remove_panel )
28
25
def _ ():
29
- if len (user_choices ) == 0 :
26
+ if len (choices ) == 0 :
30
27
ui .notification_show ("No more panels to remove!" )
31
28
return
32
29
33
- ui .remove_accordion_panel ("acc" , f"Section { user_choices .pop ()} " )
30
+ ui .remove_accordion_panel ("acc" , f"Section { choices .pop ()} " )
34
31
35
32
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 ]} "
38
35
ui .update_action_button ("remove_panel" , label = label )
You can’t perform that action at this time.
0 commit comments