Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24322] Android: SearchView: “change” event is fired on SearchView first initialization.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-02-06T21:39:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsAndroid
Labelsandroid, change, community, notable, searchview
Reportergrazianogrespan
AssigneeFrankie Merzadyan
Created2017-01-17T23:04:28.000+0000
Updated2017-02-06T21:39:34.000+0000

Description

Basically, is the same issue of TIMOB-13721 . PR: https://github.com/appcelerator/titanium_mobile/pull/8760 Step to reproduce : 1. Create Android SearchView and set value property on initialization. 2. Add “change” event listener to the SearchView. 3. Wait for the alert to appear. The change event should not fire automatically when the searchView is initialized with a text value.
////// Begin Test Case ///////
var win = Ti.UI.createWindow();

var searchView = Ti.UI.Android.createSearchView({
   value:"", // it may be any value...
   iconified: false
});

searchView.addEventListener("change",function(){
    alert("Fired Change Event!");
});

win.add(searchView);
win.open();
////// End Test Case ///////

Comments

  1. Hans Knöchel 2017-01-18

    Hey [~grazianogrespan], so it's the same as in TIMOB-13721, but with Ti.UI.SearchView instead of Ti.UI.TextField? Interesting!
  2. grazianogrespan 2017-01-18

    Yes @Hans Knoechel , exactly the same... I did not tried this issue with previous SDKs but with the actual 6.0.1.GA this "bug" exists.
  3. Hans Knöchel 2017-01-18

    Yeah, looks very valid! Moved the ticket to TIMOB already. We'll try to get it into the next patch version!
  4. Lokesh Choudhary 2017-02-06

    Verified the fix is present in SDK 6.1.0.v20170206114448. Closing.

JSON Source