emvecchi commited on
Commit
a750fda
1 Parent(s): 6fee0fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -328,13 +328,13 @@ def show_field(f: Field, index: int, data_collected):
328
  value=value, help=f.help)
329
  case 'multiselect':
330
  choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
331
- selected_values = st.session_state.get(key, data_collected.get(f.name, []))
332
- selected_values = st.multiselect(f.title,
333
- options = choices, default=selected_values,
334
  format_func=lambda x: x,
335
  key=key, max_selections=3,
336
  help=f.help)
337
- st.session_state[key] = selected_values
338
  case 'likert_radio':
339
  labels = default_labels if not f.other_params.get('labels') else f.other_params.get('labels')
340
  st.radio(f.title,
 
328
  value=value, help=f.help)
329
  case 'multiselect':
330
  choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
331
+ key = f.name + str(index)
332
+ value = st.multiselect(f.title,
333
+ options = choices,
334
  format_func=lambda x: x,
335
  key=key, max_selections=3,
336
  help=f.help)
337
+ st.session_state[key] = value
338
  case 'likert_radio':
339
  labels = default_labels if not f.other_params.get('labels') else f.other_params.get('labels')
340
  st.radio(f.title,