Streamlit Input Values Revert to Previous State After Multiple Changes

I’m building a GUI with Streamlit, and I’m facing an issue where input values update correctly the first time but reset to the previous value when I try to change them again. I have set unique keys for each input component, but the problem persists. Does anyone know how to ensure that the inputs retain their updated values across multiple changes, without reverting to previous ones?

Has anyone encountered this behavior, and how can I fix it?

It would be very helpful if can add your code here. Without looking at code, it is hard to help.