Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/ios/App/App/HerdrBridgeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ class HerdrBridgeViewController: CAPBridgeViewController {
return configuration
}

override func webView(with frame: CGRect, configuration: WKWebViewConfiguration) -> WKWebView {
WebViewWithoutFormBar(frame: frame, configuration: configuration)
}

override func capacitorDidLoad() {
bridge?.registerPluginInstance(HerdrShellPlugin())
bridge?.registerPluginInstance(OvisPushPlugin())
Expand Down Expand Up @@ -543,6 +547,15 @@ class HerdrBridgeViewController: CAPBridgeViewController {
}
}

/// The app's web view, without WebKit's form accessory bar: the up and down arrows and the check
/// mark it puts over the keyboard (#2043). The client has its own key bar, and on a phone the bar
/// took another row of the screen; a page cannot remove it. WebKit asks the web view for the
/// keyboard's accessory view (since iOS 13), so this public override does what
/// @capacitor/keyboard's `hideFormAccessoryBar` does by patching WebKit's private content view.
private final class WebViewWithoutFormBar: WKWebView {
override var inputAccessoryView: UIView? { nil }
}

/// Passes every navigation callback to Capacitor's own delegate and reports a main-frame load
/// that failed, such as a PC that is off or one that answers with an HTTP error, with its reason.
/// A load cancelled on purpose (a link handed to Safari, a new navigation) is not a failure.
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/ios-hide-form-accessory-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed
- The iOS app no longer shows WebKit's form bar (the up and down arrows and the check mark) over
the keyboard, so only Ovis's own key bar sits above it and the page keeps that row of the
screen.
5 changes: 5 additions & 0 deletions docs/native-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ What is there:
one goes with its web view. `@capacitor/barcode-scanner` kept every old one alive (its scanner
manager holds the view controller, which holds the bridge and the plugin), so
`app/patches` makes that manager for each scan instead of keeping it.
`HerdrBridgeViewController` also hides WebKit's form accessory bar (the up and down arrows and the check mark over the
keyboard), as `@capacitor/keyboard`'s `hideFormAccessoryBar` would, without that plugin or its
patch of WebKit's private content view: its web view is a `WKWebView` subclass whose
`inputAccessoryView` is nil, which WebKit asks for since iOS 13. The client has its own key bar,
and a page cannot remove WebKit's.
- In the client, `src/lib/nativeApp.ts` notices the app through `window.Capacitor`, as the app
injects it; the browser build carries no Capacitor code. Inside the app:
- Settings → Phone & devices has a Change PC row, and so does the pairing screen (a PC that
Expand Down
Loading