Problem Description
When you have a NavigationWindow, you can open a window and then obtain either:
a left arrow to close the window
you can slide the window to close or
you can actually have a button that closes the window
If you do a small slide of the window and don't actually close it, the close button won't work anymore.
Steps to reproduce
1. Create a new mobile project with Mobile SDK 3.1.3 for iOS 7
2. Paste the provided testcase and run it.
3. Click the label "open window".
4. Do a little bit of scrolling and then get it back.
5. Click on the close window button, the window won't close.
Testcase
var win2 = Titanium.UI.createWindow({
backgroundColor: 'red',
title: 'Red Window'
});
var win1 = Titanium.UI.iOS.createNavigationWindow({
window: win2
});
var win3 = Titanium.UI.createWindow({
backgroundColor: 'blue',
title: 'Blue Window'
});
var button = Titanium.UI.createButton({
title: 'Open Blue Window'
});
button.addEventListener('click', function(){
win1.openWindow(win3, {animated:true});
});
win2.add(button);
var button2 = Titanium.UI.createButton({
title: 'Close Blue Window'
});
button2.addEventListener('click', function(){
win1.closeWindow(win3, {animated:false}); //win3.close() will also work!!
});
win3.add(button2);
win1.open();
Hello, tested this code:
and works like a charm in 3.1.3.GA. Best, Mauro
Hi, I have tried it again for fourth time and it basically doesn't work. Problem has to be on your side, please can you write me what you have done? (Steps)? Thank you
Hello, 1. Create the new mobile project with MobileSDK 3.1.3.GA 2. Paste thesample code into app.js 3. Compile it to the simulator in iOS7. 4. Run it. Best, Mauro
Sorry ,but now I don't understand. Are these steps for me to try it again (It doesn't work anyway) or you have done it?
Hello Matej, I shared the code and the steps that i ran to test your issue. It works for me. What Mobile SDK are you using? Best, Mauro
And what about these steps: 1. If you can see red window (Screen "1") click on the "Open blue window". 2. Drag just a little bit blue window (Screen "2") and push it back. (The most important one) 3. Click on the "Close Blue Window" - it doesn't work.
Hello, how do you manage to do that scroll? Can you test my code and i can't scroll it as you are showing. BEst, Mauro
Just go with the cursor to the left side (Few pixels from left side), click and drag (Not completely!)
Is it working for you?
Hello, I can't do the dragging, therefore is not crashing here. That should not be draggable. Best, Mauro
Hi, the dragging is possible. Have you got device with iOS 7? If you want to go back you can click on "Back" button or drag the window. It works exactly same in the simulator ,but instead finger you have to use mouse/cursor. Please try it one more time if you won't be able do it I will make video for you. Thanks
Hello, already tried that, without success. Your video will be more than welcomed! Best, Mauro
Done, http://www.qfpost.com/file/d?g=kSS3HhutF
I got the exact instructions about how to reproduce the bug, and I can reproduce it.
Is possible to set up higher (High) priority for this bug? I think this is not just a regular bug that can wait... Thank you
Hello Matej, the priority will be set by the Platform team. Bes,t Mauro
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4889
Closing ticket as fixed. Verified closing Window inside a NavigationWindow is possible while using the original test case and kosso's test case. Tested on: Titanium Studio, build: 3.2.0.201311122225 SDK build: 3.2.0.v20131113094843 Ti CLI: 3.2.0 (4c816f21d7d9360659d77e9a6a994992ef880b72) Xcode: 5.0.2 Device: iphone 5s (7.0.2)
You can disable the slide effect?
@ info@macgrafic.com - I think you can disable it if you manually set a leftNavButton (to act as your back/window close button) when creating the window. I have custom back buttons in an app and the slide to close doesn't happen.
@kosso ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ AWESOME !!!!!!!!!!!!! I had not thought about it! Thank you so much! But you, Thank you so much! Simple but very effective ... was about to rewrite many lines for this!