Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot click on tableview after closing window with focus on SearchBar on NavigationWindow #13070

Closed
trkas opened this issue Sep 16, 2021 · 6 comments

Comments

@trkas
Copy link

trkas commented Sep 16, 2021

Describe the bug

If you have a NavigationWindow with e.g. 2 windows. Window 1 has a tableView with rows. Click on a row and window 2 is shown with a tableView with rows and a SearchBar. You click on SearchBar so background is dimmed and SearchBar gets focus and then click on the back button. The window 1 is shown but you cannot interact with the table on window 1 anymore. It's a critical bug for us so I hope you can fix it as soon as possible :o).

It's started to break from SDK 10.0.1. It works on 10.0.0

To Reproduce

Just run the following code, and you get the error as described above:

var win2 = Titanium.UI.createWindow({
title : 'window 1'
});

var table = Ti.UI.createTableView({
width : '100%',
});

win2.add(table);
var win1 = Titanium.UI.createNavigationWindow({
window : win2
});

var row = Ti.UI.createTableViewRow({
title : 'test'
});
row.addEventListener('click', function(e) {
Ti.API.info('click!');
showNextWindow();
});

var tableData = [];

tableData.push(row);

table.data = tableData;

win1.open();

function showNextWindow() {
var win3 = Ti.UI.createWindow({
title : 'window 2'
});
var search = Titanium.UI.createSearchBar();
var table2 = Ti.UI.createTableView({
search : search
});
win3.add(table2);
var row = Ti.UI.createTableViewRow({
title : 'test2',
});
var tableData = [];
tableData.push(row);
table2.data = tableData;
win1.openWindow(win3);

}

Expected behavior

After clicking on back button on window 2 after following the description as mentioned above, I expect to be able to interact with the tableView on window 1

Environment

Titanium SDK version: 10.0.1
CLI version: 9.0.1
Simulator Screen Shot - iPhone 12 - 2021-09-16 at 09 33 39
Simulator Screen Shot - iPhone 12 - 2021-09-16 at 09 33 52
Simulator Screen Shot - iPhone 12 - 2021-09-16 at 09 34 02
trace.pdf

Logs

attached trace.pdf

(Attach by dragging into this issue)

@m1ga
Copy link
Contributor

m1ga commented Sep 16, 2021

If it started with 10.0.1 it might be a regression of #12906 which had a backport to 10.0.1.
Not sure if there is a workaround by bluring the searchbar before closing the window?

@m1ga
Copy link
Contributor

m1ga commented Sep 16, 2021

@trkas you can edit the file locally iphone/Classes/TiUITableView.m (inside your mobilesdk/ folder) and switch back to the old version: https://github.com/appcelerator/titanium_mobile/pull/12906/files#diff-091b65382eb52bdd5bea8e4e965d65b6e044cac879d9e10104ac7a68e18868a8

@trkas
Copy link
Author

trkas commented Sep 16, 2021

@m1ga ok. it seems to work if I replace the TiUITableView.m from 10.0.2 to TiUITableView.m from 10.0.0 in the mobilesdk folder. It would not break anything else?

I have tried to call blur() on SearchBar when window is closed, but that doesn't seem to work.

@m1ga
Copy link
Contributor

m1ga commented Sep 16, 2021

that was the only change I saw. Also made a not in the original ticket https://jira.appcelerator.org/browse/TIMOB-28492

@garymathews
Copy link
Contributor

Thanks for reporting this, you can follow the ticket and PR here:

https://jira.appcelerator.org/browse/TIMOB-28536
#13072

@ewanharris
Copy link
Collaborator

This shipped in 10.1.0.GA, thanks for the report @trkas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants