This is a migrated thread and some comments may be shown as answers.

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

3 Answers 79 Views
SideDrawer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marc
Top achievements
Rank 1
Marc asked on 13 Jun 2017, 09:49 AM

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

3 Answers, 1 is accepted

Sort by
0
Marc
Top achievements
Rank 1
answered on 13 Jun 2017, 10:01 AM
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).
0
Nick Iliev
Telerik team
answered on 13 Jun 2017, 10:31 AM
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.
0
Marc
Top achievements
Rank 1
answered on 13 Jun 2017, 10:38 AM

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

Tags
SideDrawer
Asked by
Marc
Top achievements
Rank 1
Answers by
Marc
Top achievements
Rank 1
Nick Iliev
Telerik team
Share this question
or