Streamlit text_input behavior: value parameter vs. key parameter

Hi,
I’ve noticed an interesting behavior in Streamlit’s st.text_input() widget when using both the value and key parameters. I’d like to bring attention to this as it might be unexpected for some users.

Consider these two examples:

Example 1

#Without a key parameter:
value = st.session_state.get('subset_population')
supp = st.text_input('Enter your population list', value=value)

output

The list of subset correctly display

Example 2

#With a key parameter:
value = st.session_state.get('subset_population')
supp = st.text_input('Enter your population list', value=value, key='TEST')

output

The list of subset is None

In the second example, the widget prioritizes its own state (associated with the key) over the value parameter. This results in the widget displaying None instead of the expected value from st.session_state.get('subset_population').

It would be great if there was a way to assign a value while still using a custom key.