Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18744] touchEnabled not true by default

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-06-02T07:35:29.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsTiAPI
LabelsTCSupportTriage, button, label, qe-5.4.0, touchEnabled, view
ReporterAndrey Tkachenko
AssigneeAshraf Abu
Created2015-02-10T15:28:12.000+0000
Updated2016-07-25T22:50:18.000+0000

Description

[Documentation says](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.View-property-touchEnabled) that default value of touchEnabled must be true. This is untrue.
<Alloy>
	<Window layout="vertical" backgroundColor="#ffffff" color="#000000" >
		<Button onClick="doClick">I'm button, click me</Button>
		<Label onClick="doClick">I'm label, click me</Label>
		<View onClick="doClick" height="Ti.UI.SIZE"><Label>I'm view, click me</Label></View>
	</Window>
</Alloy>
function doClick(e) {
    alert('touchEnabled = '+typeof(e.source.touchEnabled));
}

$.index.open();

Comments

  1. Hans Knöchel 2016-05-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/8000 Test case 1: https://gist.github.com/hansemannn/6d2c919c7e584130dd1dea37b68da38f Test case 2: https://gist.github.com/hansemannn/19557b8852be1b36a646b7c45cebf2b1
  2. Chee Kiat Ng 2016-05-15

    [~hansknoechel] and Android? does [~msamah] need to do something here? I maybe thinking too much into it but, there's no 'breaking' behavior or user experience change we need to be aware of?
  3. Hans Knöchel 2016-05-15

    The only change is, that the proxy sets the default value inside the TiUIView. It's more an improvement than a bugfix. The docs could also say "default: undefined (acts as true)", but this solution makes the API a bit cleaner. I can check for Android, but as earlier comments state its happening on both platforms, we may need to pre-set it there as well. EDIT: Tested with Android, it's undefined. So we need to update it on Android as well. [~msamah]?
  4. Chee Kiat Ng 2016-05-18

    [~hansknoechel] I'm a bit skeptical of the usage of userInteractionEnabled property. According to this : https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instp/UIView/userInteractionEnabled It includes KEYBOARD as well. I'm not sure if there are cases where developers requires views that is touch disabled, but still keyboard enabled :/ by the way, good catch on the IFDEF AUTOLAYOUT for TiUIView. we should include that fix no matter what.
  5. Chee Kiat Ng 2016-05-26

    PR Merged. (PR was fixed to just set property to true but default.) [~msamah] can you do a PR for this too please?
  6. Hans Knöchel 2016-05-28

    Changes assignee to Ash for the Android-part.
  7. Ashraf Abu 2016-05-30

    PR: https://github.com/appcelerator/titanium_mobile/pull/8033 [~hpham] for your review.
  8. Ashraf Abu 2016-06-02

    PR merged.
  9. Harry Bryant 2016-07-25

    Verified as fixed, with both Android & iOS platforms, touchEnabled property is true by default. Tested On: iPhone 6S (9.3.2) Device Nexus 6P (6.0.1) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160725003348 Appc Studio: 4.7.0.201607111053 Appc NPM: 4.2.7 App CLI: 5.4.0-34 Xcode 7.3 Node v4.4.7 *Closing ticket.*

JSON Source