Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25361] iOS: Ti.UI.Slider.setValue not updating the slider

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-10-02T13:45:55.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.3.0
ComponentsiOS
Labelsconsider-6.2.3, ios, slider
ReporterRaef Akehurst
AssigneeHans Knöchel
Created2017-10-01T05:07:05.000+0000
Updated2017-10-12T04:16:06.000+0000

Description

After upgrading to Ti. SDK 6.2.2 neither of the following work on iOS.
$.slider.value = 50;
$.slider.setValue(50);
$.slider.setValue(50, { animated: true });
Expected outcome: The slider handle would move. Actual outcome: The slider handle does not move. It stays to the left. They all used to work, and they all still work on Android. I note, that the "value" changes, just the slider handle does not more.

Comments

  1. Hans Knöchel 2017-10-01

    Hey there! This could likely be a regression from TIMOB-20016, we'll investigate it for the next patch-release! *EDIT*: I am able to reproduce this when using the kroll-thread (works fine when having <property name="run-on-main-thread" type="bool">true</property> enabled in the tiapp.xml. We'll still fix it for the legacy kroll-thread, but you may consider moving to the above configuration for future projects. Thank you!
  2. Hans Knöchel 2017-10-01

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9493 PR (6_3_X): https://github.com/appcelerator/titanium_mobile/pull/9494 Test-Case:
       var win = Ti.UI.createWindow({
       	backgroundColor: 'white'
       });
        
       var btn = Ti.UI.createButton({
       	top: 100,
       	title: 'Click me'
       });
        
       btn.addEventListener('click', function(e) {
               // Also test with "slider.value = 75" and "slider.setValue(75)".
       	slider.setValue(75, {
       		animated: false
       	});
       });
        
       var slider = Ti.UI.createSlider({
       	top: 200,
       	min: 0,
       	max: 100,
       	width: Ti.UI.FILL,
       	value: 25
       });
        
       win.add(btn);
       win.add(slider);
        
       win.open();
       
  3. Samir Mohammed 2017-10-11

    Verified fix in SDK Version 6.3.0.v20171010142423 and SDK Version 7.0.0.v20171009065347. Was able to see the slider move when pressing click me. Tested with both:
       <property name="run-on-main-thread" type="bool">false</property> 
       <property name="run-on-main-thread" type="bool">true</property>
       
    *Test Steps*
       + Copied the test case from the description 
       + Added the test case into a titanium project 
       + Ran the application 
       + Pressed "Click me"
       + Saw the slider move 
       
    *Test Environment* Appcelerator Command-Line Interface, version 6.2.4 iPhone 7 emulator (11.0) iphone 6 plus (10.2) Operating System Name: Mac OS High Sierra Operating System Version: 10.13 Node.js Version: 6.10.1 Xcode: 9.0 Appcelerator Studio: 4.10.0.201709271713
  4. Raef Akehurst 2017-10-12

    Just tested the nightly build and it works great for me! :)

JSON Source