Solved. Two things together cause it:
.focusable() + .focused($isFocused) on the SwiftUI container holding the
WKWebView.
The app echoing the page's focus reports back into that state — page posts
on focus/blur, app sets isFocused = true/false.
Either alone types fine. A single focus drive at load does not reproduce; it has
to be the echo. A plain is enough — not Monaco-specific.
Fix:
if #available(iOS 27, *) {
content
} else {
content.focusable().focused($isFocused)
}
Correcting myself: a workaround does exist, and my earlier claim that
-becomeFirstResponder re-arms an endless loop was measured with .focusable()
still applied, so treat it as unverified.
FB24092251 has a standalone repro project attached.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: