summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorDavid Ortinau <david.ortinau@microsoft.com>2017-07-24 21:00:20 (GMT)
committerE.Z. Hart <hartez@users.noreply.github.com>2017-07-24 21:00:20 (GMT)
commite828fa6fa5455b9700bf5169a9868851f18e17ea (patch)
treed5af3926038bb50b7648273770c7f096976d910b /Xamarin.Forms.Platform.iOS
parent7303d60ab69a0c2b3c3e54e177efa0d54a7a08de (diff)
downloadxamarin-forms-e828fa6fa5455b9700bf5169a9868851f18e17ea.zip
xamarin-forms-e828fa6fa5455b9700bf5169a9868851f18e17ea.tar.gz
xamarin-forms-e828fa6fa5455b9700bf5169a9868851f18e17ea.tar.bz2
when closing the Picker by tapping outside or hitting done, verify the source selection index matches the UI control. When it is in spin, the animation completes offscreen and the next time it opens you see the wrong row selected. (#1054)
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs
index 50ad64a..8adbb5b 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs
@@ -86,6 +86,11 @@ namespace Xamarin.Forms.Platform.iOS
void OnEnded(object sender, EventArgs eventArgs)
{
+ var s = (PickerSource)_picker.Model;
+ if (s.SelectedIndex != _picker.SelectedRowInComponent(0))
+ {
+ _picker.Select(s.SelectedIndex, 0, false);
+ }
ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false);
}