Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12669] MobileWeb: Parity of enabled property

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-26T22:07:10.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsiOS, MobileWeb
Labelsn/a
ReporterBenjamin Hatfield
AssigneeEric Merriman
Created2013-02-12T01:31:28.000+0000
Updated2017-08-24T20:54:54.000+0000

Description

Test the following code with Chrome:
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 Mobile Web, when enabled is set to false, click events fire for TextArea and TextField. Switch, Slider and Button do not fire the click event. On Android, no click events are fired and on iOS, the click events fire for Switch, Slider, 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 jithinpv
  2. Lee Morris 2017-08-24

    Mobile Web has been deprecated and will be removed in fixVersion 7.0.0.

JSON Source