Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12668] iOS: Parity of enabled property

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-05-24T18:02:36.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterBenjamin Hatfield
AssigneeEric Merriman
Created2013-02-12T01:30:43.000+0000
Updated2017-05-24T18:02:57.000+0000

Description

Run the following code on the iOS simulator:
var VIEW_STATE = false;

var win = Ti.UI.createWindow({backgroundColor: 'white', layout: 'vertical'});

var button = Ti.UI.createButton({title: 'Button', enabled: VIEW_STATE, top: '10dp'});
button.addEventListener('click', function(e){ Ti.API.info('button:' + e.type)});
win.add(button);

var switcher = Ti.UI.createSwitch({enabled: VIEW_STATE, top: '10dp'});
switcher.addEventListener('click', function(e){ Ti.API.info('switcher:' + e.type)});
win.add(switcher);

var slider = Ti.UI.createSlider({
	top: '10dp',
    min: 0,
    max: 100,
    width: '250dp',
    value: 50,
    enabled: VIEW_STATE,
    focusable: true
});
slider.addEventListener('click', function(e){ Ti.API.info('slider:' + e.type)});
win.add(slider);

var textarea = Ti.UI.createTextArea({
	value: 'TextArea',
	enabled: VIEW_STATE,
	top: '10dp'
});
textarea.addEventListener('click', function(e){ Ti.API.info('textarea:' + e.type)});
win.add(textarea);

var textfield = Ti.UI.createTextField({
	width: '250',
	height: '60',
	enabled: VIEW_STATE,
	top: '10dp',
	borderWidth: 1	
});
textfield.addEventListener('click', function(e){ Ti.API.info('textfield:' + e.type)});
win.add(textfield);

win.open();
Results: On iOS, when enabled is set to false, click events fire for Switch, Slider, TextArea and TextField. Button does not fire the click event. On Android, no click events are fired and on MobileWeb, the click events only fire for TextArea and TextField. Expected Results: Click events should not fire if these elements are disabled.

Comments

  1. jithinpv 2013-03-25

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0 Device: Samsung galaxy s duos Android version: 4.0.4 jithinpv
  2. Lee Morris 2017-05-24

    Cannot reproduce this issue, tested with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705021158 Ti SDK 6.1.0.v20170519131839 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80

JSON Source