Bug 24580 - Custom DurationPicker makes built-in DatePicker misbehave.
Summary: Custom DurationPicker makes built-in DatePicker misbehave.
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 1.5.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-17 11:08 UTC by tim.ahrentlov
Modified: 2015-10-14 05:55 UTC (History)
5 users (show)

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


Attachments
Test case to reproduce the bug (6.93 MB, application/zip)
2014-11-17 11:11 UTC, tim.ahrentlov
Details
Video of bug (67 bytes, text/plain)
2015-10-01 07:47 UTC, tim.ahrentlov
Details

Description tim.ahrentlov 2014-11-17 11:08:15 UTC
Making an CustomDurationPickerRenderer : ViewRenderer<CustomDurationPicker, UITextField> that instantiates a UIDatePicker() makes the built-in Datepicker misbehave.

For example, selecting a date in the built-in datepicker, makes the year decrease for each selection. If I no longer use the custom duration picker, the DatePicker functions normally again. This happens in both iOS simulator and device.

I'm at a loss explaining why this is, unless it has something to do with the loading of renderers.

I've attached a small project with a *very* bareboned and incomplete duration picker, that reproduces the bug for me. 

In the shared app try to first run this:

public static Page GetMainPage ()
{	

    return new ContentPage { 

			Content = new StackLayout 
			{
				VerticalOptions = LayoutOptions.CenterAndExpand,
				Children = 
				{
						new DatePicker(),
						new CustomDurationPicker() // Comment this line out and it works.
				}
			}
		};
}

Then remove the CustomDurationPicker like this:
public static Page GetMainPage ()
{	

    return new ContentPage { 

			Content = new StackLayout 
			{
				VerticalOptions = LayoutOptions.CenterAndExpand,
				Children = 
				{
						new DatePicker()
						
				}
			}
		};
}

Notice the difference in how the date picker works. The renderer of the duration picker somehow interfers.
Comment 1 tim.ahrentlov 2014-11-17 11:11:19 UTC
Created attachment 8769 [details]
Test case to reproduce the bug
Comment 2 Parmendra Kumar 2014-11-24 11:56:52 UTC
I have checked this issue with the help of instructions provided in bug description and getting the same behaviour mentioned in bug. To reproduce this issue I have run the sample app attached in comment 1 on iOS device/simulator and able to reproduce this issue with both device and simulator.

Screencast : http://www.screencast.com/t/Q0cgu6tzng

Environment Info :

Xamarin.Forms : 1.3.0

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Enterprise Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		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)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.Mac ===

Version: 1.11.1.89 (Enterprise Edition)

=== Xamarin.iOS ===

Version: 8.4.0.43 (Enterprise Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 3 Jason Smith [MSFT] 2015-01-18 05:44:15 UTC
This bug is so cool. You dont even have to add the UIKit object to anything, you just need to new it up and it screws with the other picker. I suspect this is an issue somewhere in either iOS or the binding layer. I am looking into an even smaller reproduction which doesn't involve forms now.

Still, kickass bug.
Comment 4 tim.ahrentlov 2015-01-18 06:06:12 UTC
Jason, you rock :o)
Comment 5 Eric Maupin 2015-01-18 23:02:27 UTC
Fixed for 1.3.2-pre1
Comment 6 Rajneesh Kumar 2015-01-22 05:12:04 UTC
I have checked this issue and observed that this issue is working fine on simulator and device (iPhone 5s Version:8.1.2). 
Here is the screencast for the simulator: http://www.screencast.com/t/1OgVdzoP

This issue has been fixed, hence closing this issue.

Xamarin.Forms: 1.3.2.6299-pre1
=== Xamarin Studio ===

Version 5.7.1 (build 14)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		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)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.1.6 (Business Edition)
Hash: dd1b996
Branch: 
Build date: 2015-01-15 15:06:20-0500

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 7 tim.ahrentlov 2015-09-28 04:31:33 UTC
This bug is back. And it is critical.

I'm running 1.5.0.6447.
Comment 8 tim.ahrentlov 2015-10-01 07:47:12 UTC
Created attachment 13155 [details]
Video of bug

=== Xamarin Studio ===

Version 5.9.7 (build 9)
Installation UUID: 41b41c03-d4de-45ee-92ac-f4a30df8e7e0
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: 9.0.1.20 (Business Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

=== Xamarin.Android ===

Version: 5.1.6.7 (Business Edition)
Android SDK: /Users/tim/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

=== Operating System ===

Mac OS X 10.11.0
Darwin Tims-iMac.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 9 tim.ahrentlov 2015-10-05 10:16:19 UTC
Related to bug: https://bugzilla.xamarin.com/show_bug.cgi?id=34536
Comment 10 Jason Smith [MSFT] 2015-10-14 05:55:37 UTC
Set your picker timezone to UTC. There seems to be some weird behaviors in UIKit if you dont.

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