[TIMOB-25023] Windows: BackgroundColor won't get applied when touchEnabled=false
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-04T18:10:16.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.2.0 |
Components | Windows |
Labels | n/a |
Reporter | Shuo Liang |
Assignee | Kota Iguchi |
Created | 2017-07-26T02:50:38.000+0000 |
Updated | 2017-08-15T22:21:46.000+0000 |
Description
It seems that if you try setting certain properties like backgroundColor in the controller and NOT in the tss file, these get ignored.
Reproduce Steps:
1) Open example code attacheded in a alloy project.
2) Observe how $.square has no backgroundColor defined (commented out, line 26)
3) In index.js observe how $.square's backgroundColor is being set (to backgroundColorChecked, which is equal to red).
4) Compile and run app (can be done with -T ws-local)
5) When app launches, observe how $.square seems not to show, like it's not there. That's because the backgroundColor set in line 4 of index.js didn't really work
6) Also, observe how $.square.backgroundColorChecked=red and $.square.backgroundColorUnchecked=blue prints in the console, so the reference to the colors actually exists.
7) Go to index.tss and uncomment line #26 out.
8) Compile the app and run it again. Observe how the backgroundColor is indeed applied this time to $.square.
9) Also observe how width and height values set in lines 6 and 7 of index.js seem to be applied to $.square just fine, unlike backgroundColor.
Note
Tested this with Android and iOS and it works there.
Plus
Same EXACT behavior happens with the backgroundImage property of Ti.UI.View AND color property of a Ti.UI.Label.
Attachments
File | Date | Size |
index.js | 2017-07-26T02:50:14.000+0000 | 306 |
index.tss | 2017-07-26T02:50:31.000+0000 | 709 |
index.xml | 2017-07-26T02:50:06.000+0000 | 135 |
It turns out that the root problem is
backgroundColor
doesn't get applied when it is used withtouchEnabled=false
. I would change the title of this ticket then. Sample code:https://github.com/appcelerator/titanium_mobile_windows/pull/1057
[~kiguchi]Will this ticket need a back-port to 6_2_X ?
6_2_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1058
[~smohammed] Backported to 6_2_X. No tests needed for 6_2_X because currently
6_2_X
branch andmaster
are pretty much same. Should be ok to close this ticket.Verified fix in SDK Version 7.0.0.v20170815065413 and SDK Version: 6.2.0.v20170811022027 Test and other information can be found at: Master: https://github.com/appcelerator/titanium_mobile_windows/pull/1059 6_2_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1072 https://github.com/appcelerator/titanium_mobile_windows/pull/1074
^UPDATE: Master: https://github.com/appcelerator/titanium_mobile_windows/pull/1057 6_2_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1058