This question might be out of order for this site but I dont know where to look for something like this so I'm sorry if it is.
So I was on Google Forms making a dummy test form with a long answer question and I tried to figure out how the text area expand with its content but the resizing is disabled.
As I increased the amount of text so over 300 lorem ipsum caracters, a gap between the last line of text and the bottom of the textarea
apeared, pasting the text a couple of times only increased the amount of space. My guess is that google calculate the aproximative height of the text using the average amount of caracters fitting on a line compared to the amount of characters written in the textarea
box.
So I wondered if there was a way to detect more accurately the amount of lines in a textarea
and adjust the height of it like on google forms (but maybe better?)
I was thinking:
- Maybe having a precise mesure of every letters individual width and then calculate if the next letter will fit on the line.?
- Maybe having a hidden from view div with the same width and same text styling and quickly copy the text to the div and then copy the div's offset height to the textarea?
- Maybe I'm missing something you guys might know?
Let me know your toughts!