Desription
touchEnabled on view not working on Android. If touchEnabled property is set to false for any view it still fires the click event on that view. An app contain 3 views namely View1->View2->View3 (Parent->Child) and have registered the click event listeners for all views. Ideally when touchEnabled property is set to false for View1 (parent most) then no click event listener should fire for any view. Same is working fine for iOS. But in android it fires all the event even if touch enabled property is set to false for View1(most parent).
Test Case
var win = Titanium.UI.createWindow({
title:'Testing Touch Enabled',
backgroundColor:'#fff'
});
var view1=Titanium.UI.createView({
touchEnabled:false,
borderRadius:10,
backgroundColor:'red',
width:50,
height:50
});
var view2=Titanium.UI.createView({
//touchEnabled:false,
backgroundColor:'yellow',
});
var view3=Titanium.UI.createView({
//touchEnabled:false
});
view2.add(view3);
view1.add(view2);
win.add(view1);
view1.addEventListener('click', function(){
Titanium.API.info('VIEW 1');
alert('VIEW1');
});
view2.addEventListener('click', function(){
Titanium.API.info('VIEW 2');
alert('VIEW2');
});
view3.addEventListener('click', function(){
Titanium.API.info('VIEW 3');
alert('VIEW3');
});
win.open();
Steps to Reproduce
1. Create a project using above code
2. Run the application in android (device/simulator)
3. click on view
Expected Behaviour
Click event should not fire and logs should not get printed on console as specified in eventListener.
Actual Behaviour
Click event gets fired and logs get printed :
VIEW1
VIEW2
VIEW3
Having this same issue; anyone using a sliding menu paradigm will run into this problem as well. The work-around is to have a transparent view that sits on top of the main content view and show it when the menu opens to disable any clicks, but this often presents other problems in itself.
Any movement on this?
I can confirm the issue. I have run test case against SDK 3.2.1 and Android Emulator 4.2.2 This badly breaks UI design, please fix it!
Please fix it!
I believe this is the same issue as TIMOB-16637? Is that correct?
Hi All, I am also getting this issue, Is there any improvement? Awaiting for your response
4 years later, we're still seeing this behaviour :)
No news on this? It's still happening on SDK 6.3.0.GA & 7.X.X
still happening in 8.0.0.GA