In my experiments with callbacks it looks like I am always getting the state from the previous run. In the example below, if I enter ‘123’ nothing gets printed, if I change the string to ‘1234’ then ‘123’ gets printed and so on. Is this a bug and how can I access the current value (the just changed value)???
import streamlit as st
st.title('the callback function always outputs the previous string...')
def callback():
st.text(mytext)
mytext = st.text_input('enter text',value='',on_change=callback)