question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] StateContainer - Constraints are not working properly

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

I have found multiple bugs but I think they can be caused by the same issue: Layouts ignore set constraints when used inside of state container as a state.

Layout Layout not inside of state container (working) Layout inside of the container (not working)
Grid + Label image image
ScrollView image image
ItemView image image

But if set a specific height to that layout it shows up as: image

These all seem like they originate from how the bounds of the sub-layouts are calculated if they are calculated at all.

Expected Behavior

Images with expected behavior are in the previous paragraph.

Steps To Reproduce

I included an application repository where you can try working and not working layouts.

  1. We can just run without doing any edits why launches the app which is using a state container.
  2. If we want to see working constraints we can uncomment the Working Constraints region.
  3. If we want to see a working Scroll View we can uncomment the Working Scroll View region.
  4. If we want to see a working refresh view we can uncomment the Working Refresh View region.

Link to public reproduction project repository

https://github.com/zZHorizonZz/MAUI-Bug-Report-App

Environment

- .NET MAUI CommunityToolkit: 5.0.0
- OS: Windows 10 Enterprise (OS build 19044.2604)
- .NET MAUI: 7.0

Anything else?

No response

Issue Analytics

  • State:open
  • Created 6 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
brminnickcommented, Jun 24, 2023

should we close the issue then?

Nah, the main part of this reported issue is how StateContainer handles LayoutOption constraints. I’ve verified that behavior exists, but I need to confirm whether it’s a MAUI bug or a Toolkit bug.

1reaction
sfinn-qcicommented, Jun 21, 2023

We are also experiencing this issue on a project. Specifically, we are attempting to have a list view appear spanning the full screen for a state that is not spanning to fill the space.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Constraint Layout not working, maybe a bug in design editor?
I am creating my first app with android studio and this is my first problem: I want to try the ConstraintLayout. I have...
Read more >
Right constraint doesn't work in instance of component - Bugs
Hi folks, I'm trying to use an absolutely positioned icon in the card component. I set the position to top and right, and...
Read more >
iOS Architecture: A State Container based approach
The real problem is that MVC is a broad concept. You usually need more rules and constraints about how you should structure your...
Read more >
Conflicting constraint error messages issue/bug
Hi, first of all this looks like a common bug in the latest versions (2021/2022), there is an issue where if I have...
Read more >
Redux: When & Why to Use a State Container with Your ...
Redux is not a magic bullet, nor is it a must-have for every project. In this article, we'll examine when Redux is useful...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found