Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15985] iOS: 'change' event called twice when 'Clear' button tapped on Search Bar

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-07-06T20:43:46.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam, iOS7
ReporterMostafizur Rahman
AssigneeEric Merriman
Created2013-12-13T15:53:44.000+0000
Updated2017-07-06T20:43:50.000+0000

Description

Problem Description

CHANGE event called twice when Clear button tapped on Search Bar.

Test Environment

OS: MAC OS X 10.8.5 Ti SDK: 3.1.3 GA, 3.2.0.x Ti CLI: 3.2.0-cr3 IOS simulator 7.0

Test Code

var mainWindow = Ti.UI.createWindow();

var mainView = Ti.UI.createView();
var searchBar = Ti.UI.createSearchBar();
var table = Ti.UI.createTableView({
	search : searchBar
});

 
searchBar.addEventListener('change', function(_event) {
	 
	console.log('Text : ' + searchBar.value + ', Parameters : ' + JSON.stringify(_event));
	 
	value = searchBar.value;
});

mainView.add(table);
mainWindow.add(mainView);
mainWindow.open();

Step to reproduces

Create a simple titanium project

Update app.js to test code

Run no test environment

Type few text in search bar, clear button will appears in search Bar

Click on clear (x) button

Check console log change event will call twice

Expected Result

Change event will call twice in clear button tap

Actual Result

It should be call once

Comments

  1. Unknown 2014-04-21

    This issue was previously scheduled to be worked on in more than one sprint: * 'Release 3.0.1' (on board 'Customer Issues') * 'Release 3.1.2' (on board '3.1.X Triage') * 'Release 3.0.1/TS 3.0.2' (on board '3.1.0 Triage') Starting from JIRA Agile 6.3, an issue can only belong to a single future sprint. Read more about this change: http://docs.atlassian.com/agile/docs-0630/Sprint+Marker+Migration This issue is now scheduled for future sprint 'Release 3.1.2' (on board '3.1.X Triage'). If this is incorrect, please update the issue accordingly. This comment was automatically generated by JIRA. If it is no longer relevant, please feel free to delete it.
  2. Shameer Jan 2014-08-13

    Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA iOS SDK: 7.1 iOS iPhone Simulator: 7.1
  3. Ingo Muschenetz 2014-08-13

    [~shameerj] and [~sunila]. We should test this in 3.2.0 and 3.4.0 (latest master). * If it cannot be reproduced in 3.2.0, then mark as Can't Reproduce, with no fix version * If it can be reproduced in 3.2.0 but not in 3.4.0, mark as Fixed in 3.4.0 Reopening.
  4. Ingo Muschenetz 2014-08-14

    I see no justification this should have ben re-resolved. See my comments above, follow those instructions, and then report your updated findings.
  5. Lee Morris 2017-07-06

    I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source