Maui
Maui copied to clipboard
[BUG] Popup does not wrap content on Android after content changes
Is there an existing issue for this?
- [X] I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
If I have a popup with labels that contain long text, such that the text wraps on more than one line, then initially when the popup opens, the text displays fine. But, if the popup contains an element that might change content, such as an editor, then upon changing the content, the label text does a re-layout and no longer wraps. Interestingly, the label maintains the height that the wrapped text should have. The issue is similar to this one: https://github.com/CommunityToolkit/Maui/issues/1150 but the popup displays fine on first appearance, it is only when you click in an editor to type some text that the issue appears.
Expected Behavior
The label text should wrap even after changing content
Steps To Reproduce
- Run the sample project
- Open the popup, observe that the label text wraps. This is fine:
- Click in the editor in order to type some text, the label suddenly does a re-layout and no longer wraps:
Link to public reproduction project repository
https://github.com/Kas-code/NetMauiPopupNoWrapBug
Environment
- .NET MAUI CommunityToolkit: 7.0.0
- OS: Android version 8 (API level 26)
- .NET MAUI: 8.0.3
Anything else?
No response
Regarding Android, there is a problem with the way the Measure method is called. By applying PR #1520, you can get the following results:
https://github.com/CommunityToolkit/Maui/assets/125236133/9450e7a6-41c3-4e7f-9402-4766d4283d04
@cat0363 Great, thank you for the fix. When can this be merged in? Is there anything I can do to help? The bug is causing issues on my project.
I can confirm that this issue is now fixed using the latest pre-release package after PR #1683 was merged. Thanks @cat0363 !
This should be in v8.0.0 then. Thanks for confirming. I will close this down. Feel free to reopen if I am wrong