-
-
Notifications
You must be signed in to change notification settings - Fork 7
text decoration on Label is lost after rendering a label using HTMLLabel #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I forgot to mention that this works well with
|
@fpaaske i tested here without angular and it is working fine with same about core version. |
@farfromrefug It could be Angular issue. I tried to reproduce without, but I don't know how to use the plugin without Angular. I tried with plain XML, but it doesn't load (perhaps I'm doing something wrong) Update: I figured out the syntax for plain XML. Adding textDecoration="underline" works at first. <Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo">
<ActionBar title="My App" icon="" />
<StackLayout class="p-20">
<Label text="Tap the button" class="h1 text-center" />
<Button text="TAP" tap="{{ onTap }}" class="-primary" />
<Label text="{{ message }}" class="h2 text-center" textWrap="true" textDecoration="underline" />
</StackLayout>
</Page> Then I update the template to include ui-label, and the underline disappears. <Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" xmlns:l="@nativescript-community/ui-label">
<ActionBar title="My App" icon="" />
<StackLayout class="p-20">
<Label text="Tap the button" class="h1 text-center" />
<Button text="TAP" tap="{{ onTap }}" class="-primary" />
<Label text="{{ message }}" class="h2 text-center" textWrap="true" textDecoration="underline" />
<l:Label html="<h1>test</h1>"></l:Label>
</StackLayout>
</Page> |
Additional info; this seems to work fine on Android in all cases. So the issue seems limited to iOS. |
@fpaaske ok tried on Android indeed! Sadly my macbook is dead :s So no more iOS dev for me until further notice (will try to find a solution in september when i am back). |
How to reproduce:
Create a new project:
ns create ui-label-test --ng
cd ui-label-test
Update
items.component.html
to includetextDecoration="underline"
Run the app:
ns run ios --emulator
Observe the text decoration working fine.
Add the plugin:
npm i @nativescript-community/ui-label
Register the HTMLLabel in app.component.ts:
registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
Add an HTMLLabel in the template:
Run the app:
ns run ios --emulator
Observe that the text decoration is now gone.
You can also move the HTMLLabel to the
item-detail.component.html
. Then text decoration works fine until you navigate to the details, and back. When scrolling the list now, the underline disappears on the re-rendered list entries.package.json
The text was updated successfully, but these errors were encountered: