Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TextBlock.Text in invisible StackPanel with horizontal orientation #17492

Closed
RomanTimv opened this issue Nov 13, 2024 · 3 comments
Closed
Assignees
Labels

Comments

@RomanTimv
Copy link

Describe the bug

TextBlock doesn't display text if it was changed when containing StackPanel with horizontal orientation was invisible.
Grid or vertical StackPanel works correctly

To Reproduce

Place on View:

  • StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Background="LightGreen" IsVisible="False"
  • TextBlock inside StackPanel
  • Button

In Button.Click handler set TextBox.Text to "Test" and StackPanel.IsVisible to true

StackPanel becomes visible (green stripe) but without text in it

Expected behavior

StackPanel text is visible in StackPanel

Avalonia version

11.2.0

OS

Windows

Additional context

No response

@Gillibald
Copy link
Contributor

Please test against current master

@RomanTimv
Copy link
Author

Same behavior.

  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <StackPanel  Name="cv" Orientation="Vertical" Grid.Row="0" Margin="4" HorizontalAlignment="Stretch" Background="LightGreen" IsVisible="False">
      <TextBlock Name="tv" />
    </StackPanel>

    <StackPanel Name="ch" Orientation="Horizontal" Grid.Row="1" Margin="4" HorizontalAlignment="Stretch" Background="LightGreen" IsVisible="False">
      <TextBlock Name="th" />
    </StackPanel>

    <Button Grid.Row="2" Margin="4" Content="Show" Click="Button_Click" />
  </Grid>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            cv.IsVisible = true;
            tv.Text = "Test";

            ch.IsVisible = true;
            th.Text = "Test";
        }

On button click I got
image

@Gillibald
Copy link
Contributor

Should be fixed by: #17638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants