Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28492] iOS: SearchBar blur function not working on iOS

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2021-06-23T16:09:26.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.1
ComponentsiOS
Labelsblur, ios, searchBar
ReporterGustavo Velez
AssigneeGary Mathews
Created2021-06-11T00:00:23.000+0000
Updated2021-09-16T10:19:57.000+0000

Description

I have a view with three TableViews controlled by a custom tabs. Each TableView has a SearchBar instantiated in Alloy. When I search between the tabs, I call the blur() function on each SearchBar. However, I notice that the SearchBar does not lose focus. As a result, if I enter text in say SearchBar #1, then switch to Search #2, the search functionality breaks and will not work. However, if I go back to Search #1 and press Cancel, and then back to Search #2 that is shown when I press on the second tab, I am then able to successfully search.

Attachments

FileDateSize
image-2021-06-10-19-56-57-001.png2021-06-10T23:56:57.000+0000115717
simulator_screenshot_26393208-5C8C-49EA-BDC3-31418A1FBEB5.png2021-06-10T23:59:48.000+000060921
simulator_screenshot_C28CF3BC-5AF2-44A6-858F-1D8232183EAD.png2021-06-10T23:59:35.000+0000123540
simulator_screenshot_F75A37CF-DAB1-4E64-A6AC-1E24CC165B37.png2021-06-10T23:59:25.000+000060589

Comments

  1. Gary Mathews 2021-06-17

    *TEST CASE* 1. Enter text into _Search A_ 2. Click _Toggle List_ 3. Enter text into _Search B_, list *should* update but does not
       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 ".concat(suffix) });
       
       
         for (let i = 1; i <= rows; i++) {
           section.add(Ti.UI.createTableViewRow({
             title: "Row #".concat(i) }));
       
         }
       
         return section;
       }
       
  2. Gary Mathews 2021-06-17

    master: https://github.com/appcelerator/titanium_mobile/pull/12906
  3. Ewan Harris 2021-06-23

    merged to master and 10_0_X
  4. Michael Gangolf 2021-09-16

    Might have introduced an issue here: https://github.com/appcelerator/titanium_mobile/issues/13070 If I revert the changes it works for me again

JSON Source