SimpleToast icon indicating copy to clipboard operation
SimpleToast copied to clipboard

Toast Alignment Problem When Keyboard is Open

Open vadimue opened this issue 1 year ago • 2 comments

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

vadimue avatar Dec 06 '24 15:12 vadimue

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

sanzaru avatar Dec 09 '24 09:12 sanzaru

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

sanzaru avatar Dec 21 '24 13:12 sanzaru

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 19 '25 03:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 03 '25 03:11 github-actions[bot]