Skip to content

Commit

Permalink
fix: TextBox.VerticalContentAlignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Oct 5, 2020
1 parent 74dd965 commit 40fe514
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private void InitializeProperties()
OnTextAlignmentChanged(CreateInitialValueChangerEventArgs(TextAlignmentProperty, TextAlignmentProperty.GetMetadata(GetType()).DefaultValue, TextAlignment));
OnTextWrappingChanged(CreateInitialValueChangerEventArgs(TextWrappingProperty, TextWrappingProperty.GetMetadata(GetType()).DefaultValue, TextWrapping));
OnFocusStateChanged((FocusState)FocusStateProperty.GetMetadata(GetType()).DefaultValue, FocusState, initial: true);
OnVerticalContentAlignmentChanged(VerticalAlignment.Center, VerticalContentAlignment);

var buttonRef = _deleteButton?.GetTarget();

Expand Down Expand Up @@ -712,5 +713,20 @@ private void DeleteText()
protected override AutomationPeer OnCreateAutomationPeer() => new TextBoxAutomationPeer(this);

public override string GetAccessibilityInnerText() => Text;

protected override void OnVerticalContentAlignmentChanged(VerticalAlignment oldVerticalContentAlignment, VerticalAlignment newVerticalContentAlignment)
{
base.OnVerticalContentAlignmentChanged(oldVerticalContentAlignment, newVerticalContentAlignment);

if (_contentElement != null)
{
_contentElement.VerticalAlignment = newVerticalContentAlignment;
}

if (_placeHolder != null)
{
_placeHolder.VerticalAlignment = newVerticalContentAlignment;
}
}
}
}

0 comments on commit 40fe514

Please sign in to comment.