-
Notifications
You must be signed in to change notification settings - Fork 338
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
[BUG] CommunityToolkit.Maui.Views.Popup Button Text Alignment #1489
Comments
Hi @alaskanrogue. We have added the "needs reproduction" label to this issue, which indicates that we cannot take further action. This issue will be closed automatically in 5 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@bijington , I created a reproduction code. I will upload it below. Below is the execution result of version 6.0.0. Android.Emulator.-.pixel_2_-_api_30_5554.2023-11-04.21-03-28.mp4Below is the execution result of version 6.1.0. Android.Emulator.-.pixel_2_-_api_30_5554.2023-11-04.20-58-54.mp4Version 6.0.0 reproduces the reporting issue, but version 6.1.0 does not reproduce the reporting issue. |
@cat0363 Great that you were able to find and resolve the issue. I also created a reproduction project: https://github.com/alaskanrogue/CriticalPopup. I look forward for verification of resolution. |
@alaskanrogue , The above link is a 404 error. |
I have confirmed that the repro code I created is different from the repro code you provided, and that the problem also occurs in version 6.1.0. Additional Information: |
I don't know if it's the same as the following, but it's similar in terms of the alignment of the button text. When the text of the button in the Popup is not centered, it is necessary to check whether the screen is rotated to update it. If this is the same problem, I need to see if it can be solved in .NET 8. |
@cat0363 I agree, it appears that rotation while in the background centers the text, however on the rotated phone while totally in the foreground the issue continues to exist. The other filed issue seems to be very similar. |
@alaskanrogue , Below is the workaround I came up with.
Try adding the button's SizeChanged event and implementing the following.
The button label should now be centered even when rotated in the background. |
If you do not implement the above workaround, the issue will occur if you rotate the device while the button labels are displayed correctly. All that remains is to confirm whether this problem occurs in .NET 8. |
The workaround was successful. The application tested on is locked in portrait mode however, so I was not able to test the landscape mode. It did work in the reproduction app also but rotating had an expected impact of resizing and that was subsequently maintained when the app returned to portrait. |
I forgot to mention that this issue has nothing to do with #14712. Therefore, even if it is updated to .NET 8, it will not work as intended. |
I will create a PR regarding this matter soon. |
Im also facing this issue! |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
If a popup appears after restoring the application from a background state, the button text is aligned to the left where the text is centered if the popup is created while the application is in a foreground state.
Foreground
Background
Expected Behavior
Button text aligned center.
Steps To Reproduce
Link to public reproduction project repository
https://github.com/cat0363/MauiComm-IssueForeBackChange
Environment
Anything else?
NA
The text was updated successfully, but these errors were encountered: