Forum Discussion

meekum's avatar
meekum
Channel Surfer
4 years ago

[Solved] is "isTextEllipsized" still not working riight?

In an old post

https://community.roku.com/t5/Roku-Developer-Program/Label-isTextEllipsized-always-returns-false/m-p/409416?search-action-id=49507319911&search-result-uid=409416

someone stated that isTextEllipsized is set when the text is loaded, but that doesn't seem to be ghe case in my case.  I'm doing this in a callback for an itemContent with an onChange="onLoadFunction".  When inserting a "? m.dscr" the text is displayed but isTextEllipsized is false, whether it actually is or not.  I tried this print statement as the last statement in this function.  However, if I do the print statement in onKeyEvent(), it is set properly.  I wonder if the fact that I'm still in the callback function has anything to do with it.  What I'm trying to do is set the text opacity to a reduced value if the text is truncated.  In the above post, it was suggested to do an observeField.. I didn't try it but doubt it would work.

I noticed another odd quirk.  When I print the label, all label-related fields repeat.  That is, "text", "isTextEllipsized", etc are all listed twice.

1 Reply

  • meekum's avatar
    meekum
    Channel Surfer

    After determining what the poster meant I solved the immediate problem.  I inserted a command

      

    m.dscr.observeField("isTextEllipsized", "dscrEllipsisChanged")

    and got the results I wanted.

    Still wondering why the fields are duplicated