[TIMOB-25046] iOS: Peek and Pop functionality not working with 6.1.0 G.A and above
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-08-15T22:07:59.000+0000 |
| Affected Version/s | Release 6.1.0, Release 6.1.1, Release 6.1.2 |
| Fix Version/s | Release 6.2.0 |
| Components | iOS |
| Labels | n/a |
| Reporter | Shuo Liang |
| Assignee | Hans Knöchel |
| Created | 2017-08-01T09:26:31.000+0000 |
| Updated | 2017-08-15T23:17:41.000+0000 |
Description
Reproduce
1. Run the simple app attached in an alloy project 2. On force touch of "Open Window" button. 3. Another window should be opened. But on force touch of button, peek event is not getting fired.Note
Same issue with 6.1.0.GA 6.1.1.GA But working well on 6.0.3.GAAttachments
| File | Date | Size |
|---|---|---|
| index.js | 2017-08-01T09:26:08.000+0000 | 3416 |
| index.tss | 2017-08-01T09:26:11.000+0000 | 136 |
| index.xml | 2017-08-01T09:26:14.000+0000 | 90 |
| pop.js | 2017-08-01T09:26:08.000+0000 | 113 |
| pop.tss | 2017-08-01T09:26:11.000+0000 | 22 |
| pop.xml | 2017-08-01T09:26:14.000+0000 | 1482 |
I am able to reproduce the issue on 6.1.x, simplified test-case:
if (!Ti.UI.iOS.forceTouchSupported) { alert('NOT SUPPORTED!'); } var actions = []; var win = Ti.UI.createWindow({ backgroundColor: "white" }); // The actions to be added to the preview context. var action = Ti.UI.iOS.createPreviewAction({ title: "Directions", style: Ti.UI.iOS.PREVIEW_ACTION_STYLE_DEFAULT }); var actionCall = Ti.UI.iOS.createPreviewAction({ title: "Call", style: Ti.UI.iOS.PREVIEW_ACTION_STYLE_DEFAULT }); action.addEventListener("click", function(e) { alert("Title: " + e.title + " / Style: " + e.style + " / Index: " + e.index); }); actionCall.addEventListener("click", function(e) { alert("Title: " + e.title + " / Style: " + e.style + " / Index: " + e.index); }); var actionProfile = Ti.UI.iOS.createPreviewAction({ title: "Call Profile", style: Ti.UI.iOS.PREVIEW_ACTION_STYLE_DEFAULT }); actionProfile.addEventListener("click", function(e) { alert("Title: " + e.title + " / Style: " + e.style + " / Index: " + e.index); }); actions.push(action); actions.push(actionCall); actions.push(actionProfile); var pview = Ti.UI.createView({ height: 100, backgroundColor: 'white' }); pview.add(Ti.UI.createLabel({ text: 'Address\n Title', color: 'black' })); // Create the preview context var context = Ti.UI.iOS.createPreviewContext({ actions: actions, // Can have both Ti.UI.iOS.PreviewAction + Ti.UI.iOS.PreviewActionGroup contentHeight: 100, // When unspecified, we use the available height preview: pview }); context.addEventListener("peek", function(e) { Ti.API.warn('in peek'); }); context.addEventListener("pop", function(e) { Ti.API.warn('in pop'); }); // Assign the preview context var button = Ti.UI.createButton({ previewContext: context, // Will be ignored on unsupported devices title: "Open Window!", backgroundColor: "#A6171C", width: 200, height: 50, tintColor: "#fff" }); win.add(button); win.open();The issue was introduced by the fixing the analyser-warnings ([this line](https://github.com/appcelerator/titanium_mobile/commit/46e83b20895f110fbf0b6adcf93edd84968c4ec9#diff-e1073c3ff26a35a5c8da1098e5020788R87)). PR ready later today. Might be worth a 6.1.3!
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9289 PR (6_2_X): https://github.com/appcelerator/titanium_mobile/pull/9290
Passed FR. Fix found in SDK versions: 6.2.0.v20170815151205 7.0.0.v20170815144954