Fix nav_path_input write-after-widget error on invalid path

Use _sync_nav_path flag to defer the revert to the next rerun, before
the widget is instantiated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 16:54:52 +01:00
parent 907e7efd68
commit 64472c7850

2
app.py
View File

@@ -63,7 +63,7 @@ with st.sidebar:
st.session_state.loaded_file = None
st.rerun()
else:
st.session_state.nav_path_input = str(st.session_state.current_dir)
st.session_state._sync_nav_path = True
st.rerun()
# --- Favorites System ---