Skip to content

Background color applied twice in labels with <span>s #7379

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

Closed
tralves opened this issue Jun 20, 2019 · 1 comment · Fixed by #10701
Closed

Background color applied twice in labels with <span>s #7379

tralves opened this issue Jun 20, 2019 · 1 comment · Fixed by #10701

Comments

@tralves
Copy link
Contributor

tralves commented Jun 20, 2019

Environment
Irrelevant. Occurs both on Android and iOS. Replicable in the playground.

Describe the bug
When applying a background to a label with a formatted string, the background is re-applied in the inner <span>s. This is a problem when we have a semi-transparent background, as you can see here:

span background bug

To Reproduce
Run the sample here: https://play.nativescript.org/?template=play-vue&id=x0j7SP

Expected behavior
The background should only be applied to the label, and not in the inner span again.

Sample project
https://play.nativescript.org/?template=play-vue&id=x0j7SP&v=2

Additional context


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@tralves
Copy link
Contributor Author

tralves commented Jun 20, 2019

BTW, there is an easy workaround: set the background color of the span to transparent:

<Label textWrap="true" class="h2 description-label">
  <FormattedString>
    <Span text="Play with NativeScript!" backgroundColor="transparent"></Span>
   </FormattedString>
 </Label>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants