FormattedString inside Button has wrong background color after animation
See original GitHub issueDid you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?
Yes, I did not found any.
Tell us about the problem
When using Button
with FormattedString
inside it and the background color of the Button
is changed via animation, the background color of the FormattedString
is not changed.
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 3.2.1
- Cross-platform modules: 3.1.1
- Runtime(s): 3.2.0
- Plugin(s):
"dependencies": {
"@angular/animations": "~4.2.0",
"@angular/common": "~4.2.0",
"@angular/compiler": "~4.2.0",
"@angular/core": "~4.2.0",
"@angular/forms": "~4.2.0",
"@angular/http": "~4.2.0",
"@angular/platform-browser": "~4.2.0",
"@angular/router": "~4.2.0",
"nativescript-angular": "~4.2.0",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.4.2",
"tns-core-modules": "~3.1.0",
"zone.js": "~0.8.2"
}
This problem was not occuring with the cross-platform modules 3.0.0 and android runtime 3.1.1.
Please tell us how to recreate the issue in as much detail as possible.
Reproduced behavior in playground: https://play.nativescript.org/?id=8cArU2Fb8w0jPjDWXtvV0
- Create new {N} application:
tns create MyApp --ng
- Add
Button
withFormattedString
in it - Animate the background color of the button
- The background color of the
FormattedString
is not changed
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
view:
<Button>
<FormattedString>
<Span text="button text"></Span>
</FormattedString>
</Button>
css:
Button {
background-color: green;
animation-name: button-highligh;
animation-duration: 1s;
animation-fill-mode: forwards;
}
@keyframes button-highligh {
from { background-color: green; }
to { background-color: blue; }
}
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Why is the HTML button background color filled in wrong?
Probably your div is not postioned in a way that matches the actual button position. If you apply the background-color (e.g. via css...
Read more >UI & Styling - NativeScript Docs
<RootLayout> is a layout container designed to be used as the primary root layout container for your app with a built in api...
Read more >RadioButton - .NET MAUI - Microsoft Learn
When a radio button is unchecked, its IsChecked property is false . A radio button can be cleared by tapping another radio button...
Read more >View - Android Developers
A radio button is a two-states button that can be either checked or unchecked. ... your view is known to always be drawn...
Read more >ion-datetime - Ionic Framework
Additionally, the hour is always in the 24-hour format, so 00 is 12am on a ... When the buttons are tapped, the date...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@RadouaneRoufid Actually, I have found a workaround with the tns-core-modules@3.4.0 and tns-android@3.4.1. When you set the background-color property of the
FormattedString
to transparent (like so<FormattedString style="background-color: transparent;">
) then it works as expected. You can see the workaround in action here: https://play.nativescript.org/?template=play-ng&id=DypmBB&v=3Therefore I guess this issue can be closed as there is a workaround for this. Do you agree @tsonevn ?
Hi @doumr, I am glad to hear that you have found a workaround. However, I think that we should keep the issue open until it is fixed. Also, it would help the other user to find the suggested temporary solution.