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

Toast Alignment Problem When Keyboard is Open #42

Open
vadimue opened this issue Dec 6, 2024 · 2 comments
Open

Toast Alignment Problem When Keyboard is Open #42

vadimue opened this issue Dec 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vadimue
Copy link

vadimue commented Dec 6, 2024

First, thank you for the library! However, I’ve encountered an issue with the alignment of the toast notification when the keyboard is open. The toast gets partially hidden behind the keyboard, even though it is aligned at .bottom.

Code Snippet:

.simpleToast(isPresented: $showCopyToast, options: SimpleToastOptions(alignment: .bottom, hideAfter: 2)) {
    Label("Copied", systemImage: "square.on.square")
        .padding()
        .background(Color.containerContainer)
        .foregroundColor(Color.white)
        .cornerRadius(12)
        .padding(.top)
}

Steps to Reproduce:

  1. Use the provided code to display a toast aligned at .bottom.
  2. Open the keyboard in the app while the toast is being presented.

Expected Behavior:

The toast should remain visible and adjust its position to stay above the keyboard.

Actual Behavior:

The toast is partially hidden behind the keyboard when it appears.

Environment:

  • iOS Version: 18.1
  • Library Version: 0.10.1
Screenshot 2024-12-06 at 17 16 39
@sanzaru sanzaru self-assigned this Dec 9, 2024
@sanzaru sanzaru added the bug Something isn't working label Dec 9, 2024
@sanzaru
Copy link
Owner

sanzaru commented Dec 9, 2024

@vadimue Thanks for reporting this. I will try to reproduce and fix the reported bug.

@sanzaru
Copy link
Owner

sanzaru commented Dec 21, 2024

@vadimue I attempted to rebuild and reproduce your issue using various approaches and devices but couldn’t replicate the problem where the toast stays outside the viewport.

From your screenshot, it seems the keyboard is overlaying the view where the toast is attached.

  • Which view is the toast attached to?
  • Did you use the ignoresSafeArea modifier?

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

When branches are created from issues, their pull requests are automatically linked.

2 participants