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

Add a test to demonstrate a layout bug in Yoga #2346

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Square 'A A A' box is broken. We’ve configured it to have a height of 50.dp, but it’s also getting a width of 50.dp.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,27 @@ abstract class AbstractFlexContainerTest<T : Any> {
snapshotter(container.value).snapshot()
}

@Test fun testRowWithFixedWidthHasChildWithFixedHeight() {
val container = flexContainer(FlexDirection.Row).apply {
crossAxisAlignment(CrossAxisAlignment.Start)
modifier = WidthImpl(200.dp)
width(Constraint.Fill)
height(Constraint.Fill)
}

widgetFactory.text("A ".repeat(10)).apply {
modifier = HeightImpl(50.dp)
container.children.insert(0, this)
}

widgetFactory.text("B ".repeat(100)).apply {
container.children.insert(1, this)
}

container.onEndChanges()
snapshotter(container.value).snapshot()
}

@Test fun testChildWithUpdatedProperty() {
val container = flexContainer(FlexDirection.Column)
val snapshotter = snapshotter(container.value)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.