Hi!
I agree that this should simply be the property of a widget.
However, you can do this with some javascript. You can add javascript to the external URL field of the Open Link in Current Window command.
This code will truncate the text of a widget to the widgetâs current width, assuming the widget is called âmyLabelâ. If itâs called something else, just change the first line of code.
javascript:
{
const labelName = 'myLabel1';
const label = $(`[data-label="${labelName}"]`);
const p = label.find('p');
p.css({'overflow':'hidden','white-space':'nowrap','text-overflow':'ellipsis'});
label.css('height', p.height());
label.find('div').css('height', p.height());
$axure(`@${labelName}`).resize({width: p.width(), height: p.height()}, {});
void(0);
}
IMPORTANT: if you are on a Mac and you edit this, make sure smart quotes are not on. System Settings > Keyboard > Text > uncheck use smart quotes
Also, note that this code will act upon every widget on the page named âmyLabelâ.
Sample file: truncate-with-ellipsis.rp (47.7 KB)
[Edit]
I should have pointed out that any further set text command on a widget that has already had the CSS applied will end up truncated. I also improved the script so that resizing the field after applying the CSS doesnât break the page. (both the css above and the sample file have been updated.)