Skip to content

Commit

Permalink
fix: Do not force a visibility Visible on materialised element if mat…
Browse files Browse the repository at this point in the history
…eriazlization is not due to visibility change

Causes the HorizontalScroll bar of multiline TextBox to appear
  • Loading branch information
dr1rrb committed Oct 29, 2020
1 parent 73db47a commit af4744d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Uno.UI/UI/Xaml/ElementStub.cs
Expand Up @@ -35,7 +35,7 @@ protected override void OnVisibilityChanged(Visibility oldValue, Visibility newV
&& newValue == Visibility.Visible
)
{
Materialize();
Materialize(isVisibilityChanged: true);
}
}

Expand All @@ -52,12 +52,15 @@ private protected override void OnLoaded()
}

public void Materialize()
=> Materialize(isVisibilityChanged: false);

private void Materialize(bool isVisibilityChanged)
{
var newContent = MaterializeContent();

var targetDependencyObject = newContent as DependencyObject;

if (targetDependencyObject != null)
if (isVisibilityChanged && targetDependencyObject != null)
{
var visibilityProperty = GetVisibilityProperty(newContent);

Expand Down

0 comments on commit af4744d

Please sign in to comment.