Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Slider change events fire on window open

$
0
0

Hi All,

I am finding that the change event fires on to slider without moving it, it fires on window open.

var self = Ti.UI.createWindow({
    fullscreen : true,
});
 
var speed = Titanium.UI.createSlider({
    top : 0,
    min : 0,
    max : 20,
    width : '60%',
    value : 10
});
 
speed.addEventListener('change', function(evt) {
 
    alert('fired');
 
});
 
self.add(speed);
 
self.open();
I am using titanium 3.4.0.GA i have had to change all the calls in my app to stop rather than change events which is not the functionality i am after.

Is it supposed to do this all will i have to hack it with a fire once if statement for instance.

var self = Ti.UI.createWindow({
    fullscreen : true,
});
 
var speed = Titanium.UI.createSlider({
    top : 0,
    min : 0,
    max : 20,
    width : '60%',
    value : 10
});
 
var once = false;
speed.addEventListener('change', function(evt) {
 
    if (once) {
        alert('fired');
    }
 
});
 
self.add(speed);
 
self.addEventListener('focus', function(evt) {
 
    once = true;
 
});
Thanks

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>