Environment
- iOS 26 (23A343)
- Xcode 26
- Reproduces on device and Simulator
Description
When presenting a SwiftUI WebView
(native iOS 26 component) or a WKWebView
/UIWebView
via UIViewRepresentable
, focusing a text field inside the web view and then dismissing it breaks the keyboard layout behavior.
After returning to the main app, tapping any TextField
causes the keyboard to cover bottom controls (e.g. buttons). Expected safe area insets are not applied.
The issue is only resolved after closing and reopening the keyboard once.
Steps to Reproduce
- Open a SwiftUI screen with
WebView
(via.sheet
orNavigationLink
). - Inside the web view, tap a text field to show the keyboard.
- Dismiss the web view.
- Tap a
TextField
in the main app.
Expected Result
- Layout should adjust correctly.
- Bottom controls stay visible above the keyboard.
Actual Result
- Keyboard covers bottom controls.
- Insets are ignored until the keyboard is dismissed and reopened.
Notes
- Reproduces with:
- Native SwiftUI
WebView
(iOS 26) WKWebView
andUIWebView
viaUIViewRepresentable
- Native SwiftUI
- Presentation style (
.sheet
or navigation push) does not matter.
Example video: https://youtu.be/Epgoz1vETKU
FB: FB20386257
Sample Code
import SwiftUI
import WebKit
struct ContentView: View {
@State var url: URL?
@FocusState private var isFocused: Bool
var body: some View {
VStack {
TextField("TextField", text: .constant(""))
.focused($isFocused)
Button("HIDE KEYBOARD") { isFocused = false }
Spacer()
Button("ACTION") {
url = URL(string: "https://google.com")
}
}
.sheet(item: $url) { value in
NavigationStack {
WebView(url: value)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button("CLOSE") { url = nil }
}
}
}
}
}
}
extension URL: Identifiable {
public var id: String { absoluteString }
}
Having received some other reports that seem to be related I suspect this may be related to a known issue.
Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.
Bug Reporting: How and Why? has tips on creating your bug report.
Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see https://developer.apple.com/download/.