Hi Streamliters!
Iād like to find a way to have two text areas synchronized, meaning that each time a new letter is typed in the first one, the second text area is updated as well.
The code below updates the second text area based on the first one but only after pressing āCTRL+Enterā or exiting the first text area. Iād like to have updates when the user types new information in the first text area.
I tried to use āon_changeā with a callback function but all my tests failed
Is there any way to achieve this?
Steps to reproduce
Code snippet:
import streamlit as st
initial_text = st.text_area("Initial text",
value="I should be synchronised with my twin š„",
height=50,
label_visibility="hidden")
final_text = st.text_area("Final text",
value=initial_text.upper(),
height=50,
label_visibility="hidden")
Thanks!
PS: Obviously, the function I am trying to solve is not to get the upper case of a text. Iāve just focused on the core of the issue I am facing