Resizing a shape to fit entered text

Hi! Is there a way to set the width of a shape to fit whatever text the user has entered from a text input field? I am creating a chatbot mockup, and need to put users’ text entries into chat bubble vector shapes.
I’ve got the prototype functioning so when a user hits return the text goes into the shape, but it can be too long or too short for the bubble

Thank you for your help!!

Hi!

You’ll need to use some Javascript to get this to work. This post covers how to do that. Let me know if you run into issues.