Toast Alignment Problem When Keyboard is Open
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:
- Use the provided code to display a toast aligned at
.bottom. - 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
@vadimue Thanks for reporting this. I will try to reproduce and fix the reported bug.
@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?
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.