xamarin/Xamarin.Forms

[Bug] Toggle label parent element visibility does not rerender properly

オープン

#7,486 opened on 2019/09/12

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
help wantedp/Androidp/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

With the following xaml setting the StackLayout visibility to true does not update the size of the Label. This is incorrect if the Label content was changed while the StackLayout was not visible.

     <StackLayout IsVisible="{Binding IsVisible}">
            <Label
                Text="{Binding Field}"
                HorizontalOptions="Start"
                BackgroundColor="Gold"
            />
        </StackLayout>

Steps to Reproduce

  1. Download the attached project
  2. Edit the entry content, and verify the label size is correctly updated
  3. Hide the label by clicking the toggle button
  4. Edit the entry content
  5. Show the label by clicking the toggle button, and see that the label size is invalid (possibly cutting off some words)
  6. Edit the entry content, and observe the label update.

Expected Behavior

When the label is set to visible, I expect the label to have the correct size.

Actual Behavior

The label is either too small or too big depending if content was added or removed.

Basic Information

  • Version with issue: 4.2.0.709249
  • Last known good version: None
  • IDE: VS2019
  • Platform Target Frameworks:
    • iOS: all tested versions
    • Android: all tested versions
    • UWP: not tested

Screenshots

screen1 screen2

Reproduction Link

LabelSize.zip

コントリビューターガイド