How to bind to the current width of an element? Need to auto size text input field during typing

I have a text input field that is set to Auto width. Using the Long Answer data type, I want the height to be dynamic so need to bind the Rows to a formula, which is why I need to know the current displayed width.

Unless there is another way to make the text input field autosize while the user is typing?

You could count the number of lines in the current text with a nocode formula inside the bindable rows on the long text. What this doesnt take into consideration is lines that are so long that they span more than one row (still get counted as one row). That could be mitigated with checking the number of letters in each row, and make a formula out of that as well.

image

If you want to know the current width of the text field to use in these calculations, I believe it is available in the thisInstance

image

This makes it grow to fit your content. It doesn’t work when you delete (it doesn’t shrink). I wish I had the time to solve that, but unfortunately… this is the most I can spend on this :smiley:


1 Like