Skip to content

Conversation

@HarishwaranVijayakumar
Copy link
Contributor

@HarishwaranVijayakumar HarishwaranVijayakumar commented Oct 16, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

  • When adding a label inside a fixed-width VerticalStackLayout, the label appears to be cropped and is not fully visible.

Root Cause of the issue

  • The explicit WidthRequest was not properly considered during layout measurement. As a result, iOS and MacCatalyst did not respect the fixed width constraint, causing the label to not be fully visible.

Description of Change

  • Updated HorizontalStackLayoutManager and VerticalStackLayoutManager to use explicit Width and Height properties of the stack layout when set, instead of the passed constraints, during measurement calculations. This ensures layouts behave as expected when explicit dimensions are provided.

Issues Fixed

Fixes #14200
Fixes #18450

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - iOS
  • - Mac

Output

Before After

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 16, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 16, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

var padding = Stack.Padding;

// If explicit dimensions are set, use them instead of the passed constraints
var effectiveWidthConstraint = Dimension.IsExplicitSet(Stack.Width) ? Stack.Width : widthConstraint;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated, could consider extracting to a helper method:

private (double width, double height) GetEffectiveConstraints(
    double widthConstraint, 
    double heightConstraint)
{
    return (
        Dimension.IsExplicitSet(Stack.Width) ? Stack.Width : widthConstraint,
        Dimension.IsExplicitSet(Stack.Height) ? Stack.Height : heightConstraint
    );
}

{
public Issue14200()
{
var verticalStack = new VerticalStackLayout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test for HorizontalStackLayout with explicit HeightRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution layout-stack partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

2 participants