You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TNS 3.1 breaks background-color through css binding for iOS #4450
This is regarding the DropDown plugin. In TNS 3.0 binding the value of the class that has some background-color property defined worked flawlessly. Now after I've upgraded the demo project to 3.1 setting the background-color fails with the following error:
CONSOLE ERROR file:///app/tns_modules/tns-core-modules/trace/trace.js:165:30: Error: Failed to apply property [background-color
] with value [blue] to DropDown<dd>@file:///app/main-page.xml:3:5;. TypeError: value1.equals is not a function. (In 'value1.equ
als(value2)', 'value1.equals' is undefined)
the oldValue ends up an instance of UIColor instead of Color and thus the comparison is failing. I have not made any changes to the styling so it must be some of the changes to the TNS core that is messing up the value. In addition testing the same demo app with TNS 3.0 oldValue ends up correctly as an instance of Color
The issue can be easily simulated by using the demo project for the drop down and upgrading it to 3.1 and pressing Change Styles button once it runs.
JS: Error: Failed to apply property [background-color] with value [red] to Switch(16)@file:///app/main-page.xml:7:9;. TypeError: value1.equals is not a function
JS: Error: Failed to apply property [background-color] with value [red] to Switch(16)@file:///app/main-page.xml:7:9;. TypeError: value1.equals is not a function
JS: Error: Failed to apply property [background-color] with value [red] to Switch(16)@file:///app/main-page.xml:7:9;. TypeError: value1.equals is not a function
JS: Error: Failed to apply property [background-color] with value [red] to Switch(16)@file:///app/main-page.xml:7:9;. TypeError: value1.equals is not a function
Executing before-prepare hook from /home/sergei/Projects/Tests/SwitchBackgroundColor/hooks/before-prepare/nativescript-dev-typescript.js
Reacted by Peter Staev, Nathan Walker and aMarCruz
@sserdyuk using your test application I was not able to reproduce the issue neither on Android (tested API19 and API25) or iOS.
@PeterStaev I have also tried to reproduce the issue using your demo project but I was not able to run the demo (entry point error) so I have made this test project based on your demo logic. However, the issue is not preproducible (tested both iOS and Android - can you take a look at the test project and let me know if you can reproduce the issue?
@NickIliev Did you check the log in the terminal? The switch does change color, so it's working as expected, but each time you toggle it, an error is printed in the terminal.
Yes, sometimes styles are changed, sometimes the widget is totally messed up. So the error does not crash the app, but still seems a problem with the applying the styles.
@tsonevn I was using debugger for other reasons and stopped on this exception. Hopefully you can fix it quick, seems like Color.equals is called with a wrong type of parameter. I
$ tns info
All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬─────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.1.2 │ 3.1.2 │ Up to date │
│ tns-core-modules │ 3.1.0 │ 3.1.0 │ Up to date │
│ tns-android │ 3.1.1 │ 3.1.1 │ Up to date │
│ tns-ios │ 3.1.0 │ 3.1.0 │ Up to date │
Activity
bradmartin commentedon Jun 26, 2017
Possibly related - nstudio/nativescript-cardview#58
sserdyuk commentedon Jun 28, 2017
@PeterStaev @tsonevn This isn't just iOS or a plugin issue. It's a general 3.1 issue, here's the test app: https://github.com/sserdyuk/ns-bug-4450
NickIliev commentedon Jun 29, 2017
@sserdyuk using your test application I was not able to reproduce the issue neither on Android (tested API19 and API25) or iOS.
@PeterStaev I have also tried to reproduce the issue using your demo project but I was not able to run the demo (entry point error) so I have made this test project based on your demo logic. However, the issue is not preproducible (tested both iOS and Android - can you take a look at the test project and let me know if you can reproduce the issue?
PeterStaev commentedon Jun 29, 2017
@NickIliev , sorry but I cannot download the test project as it is included in one huge repo and I do not want to download everything...
Attaching the demo project from the DropDown repo with updated deps. So simply run
tns run iosand then press Change Styles in the app.demo.zip
sserdyuk commentedon Jun 29, 2017
@NickIliev Did you check the log in the terminal? The switch does change color, so it's working as expected, but each time you toggle it, an error is printed in the terminal.
PeterStaev commentedon Jun 29, 2017
Yes, sometimes styles are changed, sometimes the widget is totally messed up. So the error does not crash the app, but still seems a problem with the applying the styles.
bradmartin commentedon Jun 29, 2017
@manijak - does any of this look familiar from the cardview debugging you did last week?
NickIliev commentedon Jul 4, 2017
App to reproduce the issue can be found in this linked issue
sserdyuk commentedon Jul 7, 2017
@NickIliev Any update on this issue?
NickIliev commentedon Jul 7, 2017
+1 reproducible also on Android via SB template
sample application here
Steps to reproduce:
sserdyuk commentedon Jul 16, 2017
@tsonevn I was using debugger for other reasons and stopped on this exception. Hopefully you can fix it quick, seems like Color.equals is called with a wrong type of parameter. I
SvetoslavTsenov commentedon Jul 27, 2017
The fix is already available in tns-core-modules@next and will be released officially with tns-core-modules@3.2.0.
lock commentedon Aug 28, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.