This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes 7992 Changes UWP DatePicker to show the picker flyout on DatePickerFocus() #8056
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
87c51fe
Merge pull request #1 from xamarin/master
bmacombe 6f305b9
Merge pull request #2 from xamarin/master
bmacombe 4e7290f
Merge pull request #3 from xamarin/master
bmacombe 4d9b552
Merge pull request #4 from xamarin/master
bmacombe e1c667c
Merge pull request #5 from xamarin/master
bmacombe 363f86e
Merge pull request #6 from xamarin/master
bmacombe 3a16b85
Merge pull request #7 from xamarin/master
bmacombe ff7a388
Merge pull request #8 from xamarin/master
bmacombe 427da27
Merge pull request #9 from xamarin/master
bmacombe 92e0741
Setup test page
bmacombe 3aef852
initial DatePickerRenderer Changes
bmacombe 9af5663
wip
bmacombe 37325ca
Open Flyout on OnElementFocusChangeRequested
bmacombe af76e9e
Update to handle when picker not visible
bmacombe 2fca920
Merge branch 'master' into GitHub_7992
rmarinho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7992.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7992, "Datepicker is not opened when we call Datepicker.Focus() in UWP", PlatformAffected.UWP)] | ||
|
||
public class Issue7992 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var stackLayout = new StackLayout(); | ||
Content = stackLayout; | ||
|
||
stackLayout.Children.Add(new Label | ||
{ | ||
Text = "Label to keep picker from getting initial focus" | ||
}); | ||
|
||
var datePicker = new DatePicker(); | ||
stackLayout.Children.Add(datePicker); | ||
|
||
var buttonFocus = new Button | ||
{ | ||
Text = "Calls Focus() on the date picker, which should open a date picker flyout." | ||
}; | ||
buttonFocus.Clicked += (s, e) => | ||
{ | ||
datePicker.IsVisible = true; | ||
datePicker.Focus(); | ||
}; | ||
stackLayout.Children.Add(buttonFocus); | ||
|
||
var buttonNotVisible = new Button | ||
{ | ||
Text = "Makes the picker not visible and calls Focus(), which should open a full screen picker flyout." | ||
}; | ||
buttonNotVisible.Clicked += (s, e) => | ||
{ | ||
datePicker.IsVisible = false; | ||
datePicker.Focus(); | ||
}; | ||
stackLayout.Children.Add(buttonNotVisible); | ||
|
||
} | ||
|
||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this behave when the picker is set to not visible? See for instance #5159
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick test on when it's not visible, it opens but I'm not sure the positioning is great. Seems like it will open at the root coordinate of the current screen.
What I'm thinking to do is if the control isn't visible use the Full placement of the flyout, which will have the picker popup fill the current screen.
Thoughts?
I'll also update the issue page to include both a visible and not visible control.