import gradio as gr count = 0 def party(str_1, str_2, str_3): if count % 3 == 0: return str_1, "Blocks Party 😌 " + str_3, "Blocks Party 😌 " + str_2 with gr.Blocks() as demo: text_1 = gr.component("textarea") text_2 = gr.component("textarea") text_3 = gr.component("textarea") text_1.change(party, [text_1, text_2, text_3], [text_1, text_2, text_3]) text_2.change(party, [text_2, text_1, text_3], [text_2, text_1, text_3]) text_3.change(party, [text_3, text_1, text_2], [text_3, text_1, text_2]) demo.launch()