Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] Popup does not wrap content on Android after content changes

Open Kas-code opened this issue 1 year ago • 2 comments

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

  1. Run the sample project
  2. Open the popup, observe that the label text wraps. This is fine: image
  3. Click in the editor in order to type some text, the label suddenly does a re-layout and no longer wraps: image

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

Kas-code avatar Dec 17 '23 13:12 Kas-code

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 avatar Dec 25 '23 00:12 cat0363

@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.

Kas-code avatar Jan 12 '24 20:01 Kas-code

I can confirm that this issue is now fixed using the latest pre-release package after PR #1683 was merged. Thanks @cat0363 !

Kas-code avatar Mar 30 '24 11:03 Kas-code

This should be in v8.0.0 then. Thanks for confirming. I will close this down. Feel free to reopen if I am wrong

bijington avatar Mar 30 '24 13:03 bijington