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

[BUG] Snackbar and Toast corner shape changes when screen is rotated on iOS #1404

Closed
2 tasks done
cat0363 opened this issue Sep 13, 2023 · 1 comment · Fixed by #1405
Closed
2 tasks done

[BUG] Snackbar and Toast corner shape changes when screen is rotated on iOS #1404

cat0363 opened this issue Sep 13, 2023 · 1 comment · Fixed by #1405
Labels
bug Something isn't working unverified

Comments

@cat0363
Copy link
Contributor

cat0363 commented Sep 13, 2023

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

If you specify a long message that does not include line breaks for Snackbar and Toast,
the shape of the corner will change when the screen is rotated. Additionally, the Snackbar
and Toast backgrounds are not redrawn when the screen is rotated, causing messages to
protrude from the background.

I used the code below for validation.

void btnShowSnackbar_Clicked(object sender, EventArgs e)
{
    Snackbar snackbar = new Snackbar()
    {
        Text = "This is Snackbar corner test message. This is test message. This is test message. This is test message. This is test message.",                
        Action = null,
        Anchor = null,
        ActionButtonText = string.Empty,
        Duration = new TimeSpan(0, 0, 0, 0, 8500),
        VisualOptions = new CommunityToolkit.Maui.Core.SnackbarOptions()
        {
            BackgroundColor = Colors.Red,
            TextColor = Colors.White,
            CornerRadius = new CornerRadius(5),           
        }
    };
    snackbar.Show();
}

void btnShowToast_Clicked(object sender, EventArgs e)
{
    Toast toast = new Toast()
    {
        Text = "This is toast corner test message. This is test message. This is test message. This is test message. This is test message.",
        TextSize = 15,
        Duration = CommunityToolkit.Maui.Core.ToastDuration.Long
    };
    toast.Show();
}

Below are the verification results.

[Snackbar]

[Before Rotation] [After Rotation]

[Toast]

[Before Rotation] [After Rotation]

From the above, you can see that the Snackbar and Toast backgrounds are not redrawn after screen rotation.
You can also see that the shapes of the Snackbar and Toast corners have changed.

Expected Behavior

The expected result is that the Snackbar and Toast backgrounds will be redrawn even after the screen is rotated, and the corner shapes will not change.

Steps To Reproduce

The steps to reproduce are as follows.

[Steps to reproduce Snackbar]

  1. Launch apps uploaded to GitHub on iOS
  2. Press the Show Snackbar button
  3. Rotate screen from portrait to landscape

In step 3, the background of the Snackbar is not drawn to the intended size and the shape of the corners has changed.

[Steps to reproduce Toast]

  1. Launch apps uploaded to GitHub on iOS
  2. Press the Show Toast button
  3. Rotate screen from portrait to landscape

In step 3, the background of the Toast is not drawn to the intended size and the shape of the corners has changed.

Link to public reproduction project repository

https://github.com/cat0363/MauiComm-IssueSnackbarToastCorner.git

Environment

- .NET MAUI CommunityToolkit: 5.3.0
- OS: iOS 16.4
- .NET MAUI: 7.0.92

Anything else?

No response

@cat0363 cat0363 added bug Something isn't working unverified labels Sep 13, 2023
@cat0363
Copy link
Contributor Author

cat0363 commented Sep 13, 2023

Could you please assign me to create the PR for this matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant