Updating a multiline input's value after the user has started typing

@hanan1 had a great solution to a multiline input question but the thread is now closed. I want to update the content of a multiline input after the user has started typing.

I tried much of the same approach in the other thread (set states on the input and dropdown after the input’s value had changed), but the state’s value cannot contain both static and dynamic text.

I made a short gif to illustrate the problem in a simplified manner: the user makes an initial selection blue, starts typing, but since the dynamic text is no longer “initial content”, it does not change. What should I do here?

MLI_new-2-min

1 Like

Hey @sydney22,

I am sorry for the late reply, I hope you had help already. but here it is in case anyone else needs it in the future: I made a video and a sandbox file that you can use to understand how this works.

1 Like

Hi @hanan1! Wow this is incredible- thank you so much for helping me! I have one question- can you confirm maybe with a screenshot the :find and replace details? I was unclear on that part.

hi @sydney22!

sure. This part only means that when a color is already selected, the color custom state we created for the multiline input should reflect that. So when the dropdown value changes again; the find&replace looks for the word that matches the color custom value in the multiline input’s current’s value and replaces it with the new value selected from the dropdown.

1 Like

Awesome, @hanan1! Thanks for the clarification and for helping me! :slightly_smiling_face:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.