Bug 54887 - Slider's "ValueChanged" event doesn't raise during firstly position changing in XF Android
Summary: Slider's "ValueChanged" event doesn't raise during firstly position changing ...
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.3.4
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Chris King
Depends on:
Reported: 2017-04-09 13:19 UTC by Sergii Vasyliev
Modified: 2017-10-03 11:56 UTC (History)
10 users (show)

See Also:
Tags: slider ac
Is this bug a regression?: ---
Last known good build:


Description Sergii Vasyliev 2017-04-09 13:19:13 UTC
# Steps to reproduce
1) install XF nuget package. 
2) XAML content is:
        <Slider x:Name="TestSlider">

3) Code:
    public partial class BaseEditPresetView : ContentView
        public BaseEditPresetView()
            TestSlider.ValueChanged += TestSlider_ValueChanged;
        private void TestSlider_ValueChanged(object sender, ValueChangedEventArgs e)
            //Set breakpoint here
4) Set breakpoint in TestSlider_ValueChanged method 
5) Run app and change Slider's position from UI

# Expected behavior
TestSlider_ValueChanged event should be raised

# Actual behavior
TestSlider_ValueChanged doesn't raise at first time, but it works for second time and further

# Test environment (full version information)
Bug in XF It was tested with few Android devices and VS android emulator
It works as expected with XF
Comment 1 Paul DiPietro [MSFT] 2017-04-10 14:57:59 UTC
This appears to only be occurring on Android.
Comment 3 Chris King 2017-04-19 16:37:34 UTC
I'm unable to reproduce this on the version in the reproduction or on the latest master. The event is raised as soon as I start sliding the slider.
Comment 4 Jean-Daniel Gasser 2017-04-27 05:32:42 UTC
I also noticed the same bug.

Please see my question on Xamarin Forum:

I'm not alone to see this behavior.
Comment 5 Sergii Vasyliev 2017-04-27 08:42:54 UTC
I've updated nuget XF to - it seems now slider works correct, and event fires at first time as expected. 
Have anything been changed in XF ?
Comment 6 Jean-Daniel Gasser 2017-04-27 09:03:50 UTC
By my side it won't work, even with

Please be sure to try to just "tap" once the slider in the middle of it, you will see the cursor change its position on the screen, but the vent is not fired.
Please do not "slide" the cursor, but just "tap" it.

I tried in a new Xamarin Forms project with version, then upgraded packages to, but the bug still remains
Comment 7 Sergii Vasyliev 2017-05-04 08:04:15 UTC
I worked few days with my laptop (XF verion in laptop is, where this bug exists. Then I pulled changes from my laptop to my PC, and now the bug occurs again (my current version of XF on PC was Even reverse back to previous commit didn't help, although all worked before.
Then I installed XF on my PC - this resolved problem, the bug disappeared.
Then I tried to upgrade XF to latest version again - and the bug occurs again. So in my case this bug depends from version of XF (latest stable version is, although I don't understand why I had working project with before pulling changes from laptop
Comment 8 philip 2017-05-28 14:34:08 UTC
still happening for me as well
Comment 9 Chris King 2017-06-20 17:22:42 UTC
Confirmed. If you just tap on the slider the event is not fired. If you slide it the event is fired.
Comment 10 Chris King 2017-06-23 20:55:40 UTC
Having a hell of a time getting the debugger to work on this reproduction...
Comment 11 Chris King 2017-06-23 21:37:23 UTC
Reported debugging issues: https://bugzilla.xamarin.com/show_bug.cgi?id=57729
Comment 12 Jeff Dalby 2017-07-26 16:36:10 UTC
We also have the same issue, only with tapping the slider. Still occurs in the 2.3.5.x code (which makes sense given it hasn't been fixed yet).
Comment 13 Jeff Dalby 2017-07-26 16:38:12 UTC
I should add, we aren't using the value_changed event, we just have the value bound to the view model and it isn't getting updated (which I assume updates based on the value_changed event firing).
Comment 14 Jeff Dalby 2017-08-23 19:23:26 UTC
Any way to bump up the priority on this?  Our app is used in mental health care for people to track emotional state.  Half the inputs are based on the slider, and this defect makes it so we can't update past  The latest still has the issue.
Comment 15 Jeff Dalby 2017-08-23 20:30:58 UTC
Looking at the code changes here

My guess is this check:
void SeekBar.IOnSeekBarChangeListener.OnProgressChanged(SeekBar seekBar, int progress, bool fromUser)
			if (!_progressChangedOnce)
				_progressChangedOnce = true;

Is making it so the first tap is ignored.  We did some testing and if you tap a second time it works.
Comment 16 MK 2017-10-03 11:56:42 UTC
Thanks for the pointer Jeff! Following on from your suggestion I tried creating my own renderer, copy-pasting the xamarin code from github, then simply commented out the whole part:

if (!_progressChangedOnce) {
                _progressChangedOnce = true;

Have only tested very briefly but seems to work fine for me, including the original bug which that commit claims to fix... tbh I'm not sure what that addition was good for anyway?

Note You need to log in before you can comment on or make changes to this bug.