Text of FormattedString within page not visible when RadSideDrawer is added to page

4 posts, 0 answers
  1. Marc
    Marc avatar
    84 posts
    Member since:
    Oct 2013

    Posted 13 Jun Link to this post

    Hello,

    I noticed a weird behaviour and I am not sure if it is a bug in the NativeScript core or the RadSideDrawer component or if this is caused by a mistake from my side in any way.

    In some pages in our app we need to add a FormattedString with styled spans and in addition, the pages contain a RadSideDrawer instance. However, I noticed that the text of the FormattedString is not visible, if the RadSideDrawer is added to the page in XML. I just see the backgroundColor of the Label, but no text. When removing the RadSideDrawer, the Label with the FormattedString is shown as expected.

    You can access a sample project to demonstrate this issue here

    I tested this on

    • NativeScript 3.0.3 and
    • NativeScript 2.5 (tns-core-modules 2.5.2)

    ... with the same result.

    I am thankful for any advice.

     

    Best regards,

    marc

  2. Marc
    Marc avatar
    84 posts
    Member since:
    Oct 2013

    Posted 13 Jun in reply to Marc Link to this post

    Note: You just need to remove the RadSideDrawer from the XML to be able to see the FormattedString or re-add it to the page to notice, that the text is not visible (only the backgroundColor).
  3. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    294 posts

    Posted 13 Jun Link to this post

    Hello Marc,

    Thank for your test project! I can confirm that indeed the issue is a reproducible bug in tns-core-modules 3.0.1 and is caused by the usage of the short syntax when creating FormattedString. I have logged the issue here and we will update the info as soon as a stable fix is released.

    Meanwhile, as a workaround, you can use the full syntax when creating FormattedString in NativeScript core application.
    e.g.
    <Label>
        <Label.formattedText>
            <FormattedString>
                <FormattedString.spans>
                    <Span text="&#xf0d7;" fontFamily="FontAwesome" />
                    <Span text="Test 1234" fontStyle="italic"  />
                    <Span text="Test 5678" />
                </FormattedString.spans>
            </FormattedString>
        </Label.formattedText>
    </Label>


    Regards,
    Nikolay Iliev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  4. Marc
    Marc avatar
    84 posts
    Member since:
    Oct 2013

    Posted 13 Jun in reply to Nikolay Iliev Link to this post

    Hello Nikolay,

    thank you for your help. The workaround works very well and I am looking forward for a fix of this issue, thanks for logging the issue.

     

    Best regards,

    Marc

Back to Top