Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic Text Area not Dynamic

Ok so:

 

https://dev.fitbit.com/build/guides/user-interface/svg/

 

Dynamic Text Area: " you change the text content, the element height will automatically re-adjust."

 

This is false. I have created a Dynamic text element and when I change the text via:

 

document.getElementById('text').text="Some text"

 

The height stays the same as whatever it was before. I have tested this with varying amounts of text. The height never changes. 

 

Is there a way to "refresh" or "reload" the dynamic text area so that it operates as advertised?

Best Answer
3 REPLIES 3

It seems like you need to set the `text-length` attribute to a value large enough for the string.

 

.someTextField { text-length: 1024 }

or

<text  text-length="1024" />

Best Answer
0 Votes

The issue may be related to this. For a giggle, try turning off the display after you've changed the text, and then turn it back on (letting auto-off do its thing should be sufficient). See if that results in a layout update.

Peter McLennan
Gondwana Software
Best Answer

Since the post is more than four years old I wonder if the issue still hasn't been fixed?
I am developing on a Fitbit Sense using the SDK 6.1.0 and following https://dev.fitbit.com/build/guides/user-interface/svg/#dynamic-textarea 
I have still have the same problem that the textarea is NOT resized after changing its text from JS.

Is there a workaround?

Best Answer
0 Votes