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

fix(ios): properly dismiss search controller after editing #12906

Merged
merged 2 commits into from Jun 23, 2021

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Jun 17, 2021

  • Properly dismiss search controller after editing
    • Only one search controller can be active at a time
NOTE: No idea why the delay is necessary, it's originally from here
TEST CASE
  1. Enter text into Search A, table should update with filtered results
  2. Click Toggle List
  3. Enter text into Search B, table should update with filtered results
const win = Titanium.UI.createWindow({ layout: 'vertical' });
const toggle = Ti.UI.createButton({ top: 80, title: 'Toggle List' })
const search_a = Ti.UI.createSearchBar({ hintText: 'Search A' });
const search_b = Ti.UI.createSearchBar({ hintText: 'Search B' });
const tableView_a = Ti.UI.createTableView({
    data: [ createSection(5, 'A') ],
    search: search_a,
    height: '40%'
});
const tableView_b = Ti.UI.createTableView({
    data: [ createSection(5, 'B') ],
    search: search_b,
    height: '40%',
    visible: false
});

toggle.addEventListener('click', e => {
    tableView_a.visible = tableView_b.visible;
    tableView_b.visible = !tableView_b.visible;

    if (!tableView_a.visible) {
        search_a.blur();
    }
    if (!tableView_b.visible) {
        search_b.blur();
    }
});

win.add([toggle, tableView_a, tableView_b]);
win.open();

function createSection(rows, suffix) {
    const section = Ti.UI.createTableViewSection({
        headerTitle: `Section ${suffix}`
    });

    for (let i = 1; i <= rows; i++) {
        section.add(Ti.UI.createTableViewRow({
            title: `Row #${i}`
        }));
    }

    return section;
}

JIRA Ticket

@garymathews garymathews added ios bug no tests backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels Jun 17, 2021
@garymathews garymathews added this to the 10.1.0 milestone Jun 17, 2021
@build build requested a review from a team June 17, 2021 23:41
@build
Copy link
Contributor

build commented Jun 17, 2021

Fails
🚫 Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 2 tests have failed There are 2 tests failing and 726 skipped out of 10653 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.Network.HTTPClientTLSv3 support (11)0.21
Error: Could not determine TLSv3 support.
at HTTPClient.onerror (/ti.network.httpclient.test.js:758:20)
ios.ipad.Titanium.UI.WebView#findString() #findString with configuration (14.4.0)30
Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by 🚫 dangerJS against da0e359

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I also tested it with my own ListView/TableView search bar test scripts and it works fine.

Copy link
Collaborator

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Pass!

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

Successfully merging this pull request may close these issues.

None yet

4 participants