Bug 41424 - DatePicker doesn't lose focus on Cancel
Summary: DatePicker doesn't lose focus on Cancel
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
: 41522 ()
Depends on:
Reported: 2016-06-01 07:59 UTC by Andreas
Modified: 2016-06-30 12:12 UTC (History)
6 users (show)

Tags: ac
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 Andreas 2016-06-01 07:59:45 UTC
To reproduse:
Add a DatePicker named i.e. "dp" and a Button to a page.
On button Click event, do "dp.Focus()" in order to bring up the DatePicker.

Then the datepicker is shown, select "Cancel".

Now, try to click the same button again. The DatePicker will NOT be shown.

The reason for this is that the DatePicker (dp) is still focused (dp.IsFocused == true). So, doing "dp.Focus()" will not change it's focus and thus NOT bring the DatePicker up.
Comment 1 Paul DiPietro [MSFT] 2016-06-06 16:01:31 UTC
*** Bug 41522 has been marked as a duplicate of this bug. ***
Comment 2 thomas 2016-06-06 16:14:35 UTC
Is there any work around?
Comment 3 Paul DiPietro [MSFT] 2016-06-06 16:20:02 UTC
I have a PR up for it right now (https://github.com/xamarin/Xamarin.Forms/pull/204/). The DatePickerDialog being cancelled isn't calling Unfocus on the Element which is why it can't be called again.
Comment 4 thomas 2016-06-06 17:10:45 UTC
Seeems there is a problem with IOs 9
Comment 5 Paul DiPietro [MSFT] 2016-06-06 17:28:37 UTC
In this case, if you've found something which you believe may be a bug, please file a separate ticket with a reproduction as it would be of help.
Comment 6 thomas 2016-06-06 19:20:26 UTC
I was only referring to the build report in your PR ;-)
Comment 7 Rui Marinho 2016-06-16 17:58:01 UTC
Should be fixed in 2.3.1-pre1
Comment 8 Parmendra Kumar 2016-06-30 12:12:13 UTC
I have checked Bug #41522 and its working fine with Xamarin.Forms 2.3.1-pre1 and Bug #41522 is duplicate bug of this bug.

Hence marked this bug as Verified.