Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4757] optionDialog with 100+ options slows to a crawl iOS 10.2+

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNot Our Bug
Resolution Date2017-01-27T19:04:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, ios-10, optionaDialog, titanium
ReporterMike Stancliffe
AssigneeShak Hossain
Created2017-01-27T18:47:28.000+0000
Updated2017-01-27T19:40:22.000+0000

Description

optionDialog with 100+ options slows to a crawl on iOS 10.2+. Showing a optionDialog with many options loads very slowly and once loaded scrolls very slowly as well. I have tested the same code on varying versions of the Titanium SDK all with the same result, the key seems to be something changed between iOS 10.1 and 10.2 as it works much better in 10.1. This issue is not seen android as everything loads instantly
var c = 0;
var options = [];
    
while(options.length<200){
 options.push(c);
 c++;
}

var oDialog = Ti.UI.createOptionDialog({
 options:options,
 title: 'Options',
});

oDialog.addEventListener('click', function(e) {
 alert(options[e.index]);
});

function doClick(e) {
 oDialog.show();
}

$.index.open();
<Alloy>
	<Window class="container">
		<Button id="label" onClick="doClick">Hello, World</Button>
	</Window>
</Alloy>

Comments

  1. Mike Stancliffe 2017-01-27

    As an added note, the issue is still present in iOS 10.3 Public Beta 1
  2. Hans Knöchel 2017-01-27

    Hey Mike, thanks for the ticket! Two things here: 1. You should reaaaaally not use a 100 options in an option-dialog. It's supposed to handle 2-5 actions, very unusually a bit more. Use the Ti.UI.ListView for those cases 2. It sounds like an iOS bug which we can't influence at our end. Please file a radar at Apple so they are aware of it. Thanks!
  3. Sharif AbuDarda 2017-01-27

    Hello, I have tested your sample code in iOS 10.2 simulator. For me the options load withing 3s. And I can scroll fine. In Android the options load instantly. Tested with SDK 6.0.1.GA.
  4. Mike Stancliffe 2017-01-27

    It runs significantly better on the simulator, please try it on a device.
  5. Sharif AbuDarda 2017-01-27

    Hello [~cliff_stander], As Hans mentioned, it's an iOS bug which we can't influence at our end. Please file a radar at Apple so they are aware of it. Thanks!

JSON Source