Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 4d6742c

Browse files
Fix a placeholder issue in the first selection attempt
1 parent a3e1583 commit 4d6742c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/MaterialDesignControls.iOS/Renderers/MaterialPickerRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static void Init() { }
2121
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Picker> e)
2222
{
2323
base.OnElementChanged(e);
24+
2425
if (this.Control != null)
2526
{
2627
this.Control.BorderStyle = UITextBorderStyle.None;
@@ -54,7 +55,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
5455
var customPicker = (CustomPicker)Element;
5556
if (e.PropertyName == nameof(customPicker.SelectedIndex))
5657
{
57-
if (customPicker.SelectedItem == null && !string.IsNullOrEmpty(customPicker.Placeholder))
58+
if (customPicker.SelectedItem == null && Control.Text == null && !string.IsNullOrEmpty(customPicker.Placeholder))
5859
{
5960
this.Control.Text = null;
6061
this.Control.AttributedPlaceholder = new NSAttributedString(customPicker.Placeholder, foregroundColor: customPicker.PlaceholderColor.ToUIColor());

0 commit comments

Comments
 (0)