Auto-fit width + set widget text

rp-7

#1

I set a text widget to “auto-fit width”. Later, when some event fires, that text is set to something else. I was expecting the widget to be resized to fit the widget now that it has new text in it, but it’s not doing that (I can tell because the widget’s border doesn’t change size).

Am I using this incorrectly, or do I need some lowered expectations?


Not fitting with "Fit to Content in HTML" in Repeater when DP state change or show/hide from Action
#2

the width updates in axure, not in the prototype. dynamic text changes do not lead to a change in the returned value for the width.
to get the real width you have to use javascript.

the example is getting the height to reposition widgets below. you will not be able to do this inside a repeater because you have no unique widget-name (data-label).
positionbelow.rp (68.4 KB)


AUTO-FIT widgets based on variable text length
#3

Hi Gregor, I don’t know if you are still active on the forum, but I have a query about this javascript solution for repositioning based on an autofit box content change:

javascript:void($axure.setGlobalVariable(“newHeight”,$( “[data-label=headline] .text”).height()));

This works fine, as in the demo, on a box with autofit height, shwoing the new value once the height changes. However, once I change the autofit to the width, and the command to “data-label=headline] .text”).width())); when I click the ‘Get height’ (in my case width) button in the demo, although the text box width changes as required, it does not return the new box width value, only the original width.

Any ideas why this might be so?
Thanks