Summary
Hi, guys!
I am using st.data_editor so that the user can input data in the project. Point is, when I use ‘on_change’ to call a function ‘ABC’, that receives as input that same data, the function is called on the previous data, not on the ‘changed’ data.
Steps to reproduce
Code snippet:
st.session_state['demanda_sugerida_unica'] = pd.DataFrame({'demanda_sugerida_unica': [st.session_state['demanda_sugerida_unica']]})
st.session_state['demanda_sugerida_unica_edit'] = st.data_editor(st.session_state['demanda_sugerida_unica'], hide_index=True, on_change=ABC())
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior / Actual behavior
It was expected the the function ABC was run with the new st.session_state[‘demanda_sugerida_unica_edit’] value, but it’s running with the old value instead.
In other words, if my current value is X and I change it to Y, I need my function ABC to be ran with Y, not X.