Forum Discussion
Automatically resize text box to fit text variables?
Hello.
Has anyone discovered a way to get a text box to dynamically resize to fit the length of a text variable? The text box in question is coloured with an outline and drop shadow and needs to hug the text with even margins. The variable is between 20 and 200 words.
With 'adjust height to fit text' selected, the text shrinks to fit the box rather than the box expanding to fit the text.
If I oversize the text-box, the text stays the correct size but I end up with massive top/bottom margins on the shorter strings which made our visual designer exclaim "Eeek, no!"
I have tried using a separate rectangle and resizing it using JavaScript (using string length of the variable to roughly calculate the height) but the outline and drop shadow on the text box get stretched (A second "Eeek!" was heard at this point).
Do I need to draw my own rectangles using JavaScript or is there a better way? Am I missing something really obvious? It seems weird that this is so difficult to do!
Thanks!
1 Reply
- KellyAunerStaff
Hi Vic!
Thanks so much for detailing your course set up. Are you able to share a screenshot or a of copy of your file for our Support Engineers to test? I tested the Autofit option with sample text, and it doesn't appear to result in large margins. Is this something that may work for your designer? If you select expand height, the text box will adjust to fit the text.
Please let me know if this helps!
Related Content
- 9 months ago
- 29 days ago
- 9 months ago
- 9 months ago
- 9 months ago