Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25055] Windows: touchEnabled false not working when in controller

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-08-11T05:56:38.000+0000
Affected Version/sRelease 6.1.1
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsn/a
ReporterNeeraj Mishra
AssigneeKota Iguchi
Created2017-08-02T07:12:01.000+0000
Updated2017-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

  1. Kota Iguchi 2017-08-03

    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 line JSON.stringify(_evt).

    JSON.stringify enumerates all properties in _evt

    _evt has source property, which points to the button

    Thus, JSON.stringify enumerates all properties in the button including enabled property

    JSON.stringify access enabled property and Titanium prints out the warning

  2. Kota Iguchi 2017-08-03

    https://github.com/appcelerator/titanium_mobile_windows/pull/1059
  3. Samir Mohammed 2017-08-10

    [~kiguchi] Master is merged. Waiting for 6_2_X.
  4. Kota Iguchi 2017-08-11

    Merged to 6_2_X.
  5. Samir Mohammed 2017-08-15

    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

JSON Source