Hi All!

It seems that setting very long string to the text property of classes
that decorate UITextField (e. g. Label) causes dead loop and time out
exception. Take a look at truncateToFit() method in UITextField class.
You could find this block there:

            while (s.length > 1 && textWidth + TEXT_WIDTH_PADDING > w)
            {
                                s = s.slice(0, -1);
                                super.text = s + truncationIndicator;
            }

It means that actual text is cut char by char until result of its
concatenation with truncation indicator fits into the width available
or only one char left. When text is very long the problem described
above appears. I believe it would work much more faster using
"division by 2". In this case even 64K text truncation will take only
16 loop cycles. Hope this will be fixed in future releases.

Sergey.

Reply via email to