Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25850] iOS: SearchBar doesn't show Bookmark button when set on creation in TableView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-08-24T17:30:31.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sRelease 7.5.0
ComponentsiOS
Labelsqe-7.1.0
ReporterEric Wieber
AssigneeVijay Singh
Created2018-03-08T20:48:57.000+0000
Updated2018-08-24T17:30:48.000+0000

Description

When showBookmark is set to true on creation of the searchbar and it is in a TableView, the bookmark button does not show. *Steps to reproduce issue* 1. Create a new project with the below code 2. Run the project *Expected Results* The searchbar has the bookmark button shown *Actual Results* The searchbar does not have the bookmark button shown *Notes* The bookmark button can be toggled to show it, but the toggle has to be tapped twice, since it thinks it is being shown. Also, if you just create a searchbar with showBookmark = true, then the button will show. Having the searchbar in the tableview does not show the bookmark button. *Code* Classic:
var win = Ti.UI.createWindow();

var searchBar = Titanium.UI.createSearchBar({
    showBookmark: true
});

var table = Ti.UI.createTableView({
    data: [{
        title: "Toggle Bookmark button"
    }],
    search: searchBar
});

table.addEventListener('click', function(e){
	searchBar.showBookmark = !searchBar.showBookmark;
});

win.add(table);
win.open();
Alloy: index.xml
<Alloy>
  <Window>
    <TableView>
      <SearchBar id="search" showBookmark="true"/>
      <TableViewRow onClick="toggle" title="Toggle bookmark button"/>
    </TableView>
  </Window>
</Alloy>
index.js:
function toggle() {
	$.search.showBookmark = !$.search.showBookmark;
}

$.index.open();

Comments

  1. Vijay Singh 2018-03-13

    PR - https://github.com/appcelerator/titanium_mobile/pull/9932 Test Case -
       var win = Ti.UI.createWindow();
        
       var searchBar = Titanium.UI.createSearchBar({
           showBookmark: true,
           hintText: 'Search text',
           hintTextColor: 'red',
           showCancel: true,
           color : 'blue',
           keyboardType:  Ti.UI.KEYBOARD_TYPE_NUMBER_PAD,
       });
        
       var table = Ti.UI.createTableView({
           data: [{
               title: "Toggle Bookmark button"
           }],
           search: searchBar
       });
        
       table.addEventListener('click', function(e){
       	searchBar.showBookmark = !searchBar.showBookmark;
       });
        
       win.add(table);
       win.open();
       
    *EDIT* - Changes of this PR is included in PR of TIMOB-25866.
  2. Samir Mohammed 2018-07-19

    *Closing ticket*, Verified fix in SDK Version: 7.4.0.v20180717131401 *FR Passed (Test Steps):*

    Created a titanium Application

    Added the following code above in to the app.js

    Ran the program

    Able to see Bookmark button on creation

    Pressed the toggle button

    Able to see the bookmark toggle on/off

    *Test Environment*
       APPC Studio: 5.0.0.201712081732
       APPC CLI: 7.0.4
       iPhone 6 simulator (11.2)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13
       Node.js Version: 8.9.1
       Xcode 9.2
       

JSON Source