Bug 39407 - Picker wrong SelectedIndex value
Summary: Picker wrong SelectedIndex value
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.0.0
Hardware: All All
: High normal
Target Milestone: ---
Assignee: David Ortinau [MSFT]
: 39408 ()
Depends on:
Reported: 2016-03-07 12:56 UTC by Rohit
Modified: 2017-08-23 19:44 UTC (History)
7 users (show)

Tags: ac, picker, ios, fr
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rohit 2016-03-07 12:56:03 UTC
Once the chooser pops up after tapping the picker in iOS, if I adjust the selected item and press the "Done" button very quickly (i.e. before the "wheel" animation has completely finished moving), the newly selected item is not accepted by the picker and it still shows the previous value.

I was able to reproduce the issue on the following versions - Xamarin.Forms, Xamarin.Forms, Xamarin.Forms
Comment 1 Sebastien Pouliot 2016-03-07 14:21:45 UTC
*** Bug 39408 has been marked as a duplicate of this bug. ***
Comment 2 Sebastien Pouliot 2016-03-07 14:25:13 UTC
That sounds like a Forms issues.

If not then please re-assign it back to XI and include all version information [1] and a test case.

[1] The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 3 Rohit 2016-03-09 10:50:42 UTC
=== Xamarin Studio ===

Version 5.10.3 (build 26)
Installation UUID: 63ebd969-050f-4a4d-9d58-80f9e046c729
	Microsoft .NET 4.0.30319.42000
	GTK+ 2.24.23 (MS-Windows theme)
	GTK# 2.12.30

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: C:\Users\Administrator\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1

SDK Build Tools Version: 23.0.2

Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 510030026
Git revision: ac9b7fcba9ee92ac30c8eb90f20c2228ce033efa
Build date: 2016-03-01 19:16:08-05
Xamarin addins: 633fde3bf405e3c402a51980976c431c204cf4f6
Build lane: monodevelop-windows-cycle6-c6sr2

=== Operating System ===

Windows 6.3.9600.0 (64-bit)
Comment 4 Rohit 2016-03-09 10:51:46 UTC
Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

Visual Basic 2015   00325-60002-13802-AA755
Microsoft Visual Basic 2015

Visual C# 2015   00325-60002-13802-AA755
Microsoft Visual C# 2015

Visual C++ 2015   00325-60002-13802-AA755
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00325-60002-13802-AA755
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015 (RC1 Update 1)   14.1.11120.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.7.1   14.0.11112.0
Azure App Service Tools v2.7.1

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JetBrains ReSharper Ultimate 10.0.2   Build 104.0.20151218.120627
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2015 ENU   14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin (f869dba)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (46c3f7e)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (49ba15e)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 5 Jason Smith [MSFT] 2016-03-11 09:05:28 UTC
I am unable to recreate this locally. Can you make a video of the issue maybe along with a test case? Maybe im not fast enough?
Comment 6 Samantha Houts [MSFT] 2017-02-23 18:42:08 UTC
Should be fixed in 2.3.5-pre1. Thank you!
Comment 7 Saurabh Paunikar 2017-07-10 11:52:20 UTC
On xamarin.form version observed that issue is not fixed. Hence reopening the issue

ScreenCast link : https://www.screencast.com/t/rBftvggatOT
Comment 8 David Ortinau [MSFT] 2017-07-13 13:19:40 UTC
PR: https://github.com/xamarin/Xamarin.Forms/pull/1054

The issue appears to be there is no selected value change, so the normal model/delegate methods don't fire that a selection has changed. I verified this is how UIPickerView on iOS and the delegate behaves outside of Xamarin.Forms. 

So in this case, I check the selection of the model against the picker itself when it is closed and reset the picker to the model's selected index.
Comment 9 Samantha Houts [MSFT] 2017-08-23 19:44:02 UTC
Should be fixed in 2.4.0-pre1. Thank you!