[TIMOB-25055] Windows: touchEnabled false not working when in controller
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-11T05:56:38.000+0000 |
Affected Version/s | Release 6.1.1 |
Fix Version/s | Release 6.2.0 |
Components | Windows |
Labels | n/a |
Reporter | Neeraj Mishra |
Assignee | Kota Iguchi |
Created | 2017-08-02T07:12:01.000+0000 |
Updated | 2017-08-15T17:58:08.000+0000 |
Description
Problem Description:
NOT to confound with what was reported on TIMOB-24328 , where the test case was much simpler (the whole test case UI was all in index.xml).
There seems to be an issue when placing a Ti.UI.Button with touchEnabled = false in a separated controller, and instantiating that controller in another whole different one. When doing this, for some reason, the touchEnabled = false property loses its effect.
Steps to Reproduce:
1) Go to Sample project 2's source code and open index.xml - observe how there's only a Window there (mainContainer)
2) In the same project, go to index.js - observe how there's an instance of testController being added to mainContainer
3) In the same project, go to testController.xml - observe its UI structure: only a View (modal) and a Button (touchEnabledFalseButton) within it.
4) In the same project, go to testController.tss - observe touchEnabledFalseButton's style: touchEnabled property is set to false
5) In the same project, go to testController.js - observe the event listener added to touchEnabledFalseButton, which prints the event object in the console.
6) Run this sample project (can be done in a -T ws-local app)
7) A window with a red button on it will be shown
8) Click the red button
9) Observe how the event object gets printed on every click, despite the fact the button has touchEnabled = false on testController.tss
10) ALSO observe how "Ti.UI.View.enabled property is deprecated. Please use touchEnabled." gets printed. - Why would this be printed? The project is NOT using the "enabled" property ...
Note:
Again, this is a very specific scenario, since in it's been demonstrated the most simple possible scenario (Sample project 1) works fine.
Comments
JSON Source
I was able to reproduce this. Just a side note and following up just in case: The message
Ti.UI.View.enabled property is deprecated. Please use touchEnabled.
is not a bug. It is displayed because of the lineJSON.stringify(_evt)
.JSON.stringify
enumerates all properties in_evt
_evt
hassource
property, which points to the buttonThus,
JSON.stringify
enumerates all properties in the button includingenabled
propertyJSON.stringify
accessenabled
property and Titanium prints out the warninghttps://github.com/appcelerator/titanium_mobile_windows/pull/1059
[~kiguchi] Master is merged. Waiting for 6_2_X.
Merged to 6_2_X.
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