Skip to content

Commit

Permalink
fix(iOS): Timepicker flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Jan 12, 2021
1 parent d4912c5 commit 6223238
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Uno.UI/UI/Xaml/Controls/TimePicker/TimePickerSelector.iOS.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if XAMARIN_IOS
#if XAMARIN_IOS

using Foundation;
using System;
Expand Down Expand Up @@ -42,7 +42,8 @@ private protected override void OnLoaded()
SetPickerTime(Time.RoundToNextMinuteInterval(MinuteIncrement));
SaveInitialTime();
_picker.ValueChanged += OnValueChanged;

_picker.EditingDidBegin += OnEditingDidBegin;

var parent = _picker.FindFirstParent<FrameworkElement>();

//Removing the date picker and adding it is what enables the lines to appear. Seems to be a side effect of adding it as a view.
Expand All @@ -52,7 +53,13 @@ private protected override void OnLoaded()
parent.AddSubview(_picker);
}
}


private void OnEditingDidBegin(object sender, EventArgs e)
{
//We don't want the keyboard to be shown. https://github.com/unoplatform/uno/issues/4611
_picker?.ResignFirstResponder();
}

private void OnValueChanged(object sender, EventArgs e)
{
_newDate = _picker.Date;
Expand Down

0 comments on commit 6223238

Please sign in to comment.