duongthienz commited on
Commit
e7cae6c
·
verified ·
1 Parent(s): 1a1c3e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -689,10 +689,13 @@ try:
689
  st.sidebar.markdown(f"**{display_label}**")
690
  if sp in file_clips:
691
  st.sidebar.audio(file_clips[sp], format="audio/wav")
 
 
692
  new_name = st.sidebar.text_input(
693
- f"Rename {display_label}",
694
  placeholder="e.g. John",
695
- key=widget_key
 
696
  )
697
  if new_name.strip():
698
  st.session_state.speakerRenames[currFileIndex][sp] = new_name.strip()
 
689
  st.sidebar.markdown(f"**{display_label}**")
690
  if sp in file_clips:
691
  st.sidebar.audio(file_clips[sp], format="audio/wav")
692
+ # IMPORTANT: label must stay fixed (use sp, not display_label) so Streamlit
693
+ # does not treat it as a new widget and reset its state on every rerun.
694
  new_name = st.sidebar.text_input(
695
+ sp,
696
  placeholder="e.g. John",
697
+ key=widget_key,
698
+ label_visibility="collapsed"
699
  )
700
  if new_name.strip():
701
  st.session_state.speakerRenames[currFileIndex][sp] = new_name.strip()