Ellipsis problems


I am trying to add an ellipsis to a text block when the text overflows using something like this

return go.GraphObject.make(go.TextBlock,
        stretch: go.GraphObject.Horizontal,
        wrap: go.TextBlock.WrapFit,
        overflow: go.TextBlock.OverflowEllipsis

In the documentation, it does say “For OverflowEllipsis to work, you must also set wrap to TextBlock.None or limit the number of lines with maxLines.”, neither of which I’m doing so I guess I can’t expect it to work.But it almost does… I see an ellipsis but that is followed by the text ‘undefined’. Once I make my shape big enough for the ellipsis to disappear then ‘undefined’ disappears as well.

To explain what I’m trying to do, I want the text in my shape to wrap as required but if the user makes it too small for all the text to appear then an ellipsis appears. So I can’t really set maxLines since I don’t know what it will be

That bug sounds familiar – I think we fixed it a while ago. What version are you using? Try upgrading to the latest version.

We are using 1.5.6, it doesn’t look like anything related has changed in 1.5.7? I will give it a go tomorrow

Hmm, we haven’t changed anything with ellipses for 1.5.7.

Can you reproduce the problem you’re seeing so we can take a look? You could fork this codepen and add your template to start.

I’ll give it a go. Our template is a little complex and I’ve just been pulled onto something else so it might take a while

There’s an example here http://codepen.io/anon/pen/wKMZOP that shows the problem.

I see. Thanks for the reproducible case, we’ll be sure to fix this for the next release.

Thanks again for the test case. We have fixed this for the next release, which should be live tomorrow.

You can see the fix here: http://codepen.io/simonsarris/pen/ojxgOj

(That’s the same code you provided except it points to gojs.net/beta, which is using the 1.5.8 pre-release right now, instead of gojs.net/latest.)

Great, thanks for the super speedy turnaround!

1.5.8 is now live, so the example codepen you linked to now works as expected.

A post was split to a new topic: Text ellipsis property moves port position?