Skip to content

Commit 58f1de6

Browse files
committed
Enable swipe from left and from right in OH admin pages
Signed-off-by: DigiH <17110652+DigiH@users.noreply.github.com>
1 parent d719a83 commit 58f1de6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

openHAB/UI/OpenHABWebViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ class OpenHABWebViewController: OpenHABViewController {
119119
super.viewDidLoad()
120120
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
121121
attachWebViewToLayout(webView)
122+
webView.allowsBackForwardNavigationGestures = true
122123

123124
loadingOverlay.backgroundColor = .systemBackground
124-
loadingOverlay.isHidden = true
125+
loadingOverlay.isHidden = false
125126
loadingOverlay.translatesAutoresizingMaskIntoConstraints = false
126127
view.addSubview(loadingOverlay)
127128
NSLayoutConstraint.activate([
@@ -515,6 +516,8 @@ class OpenHABWebViewController: OpenHABViewController {
515516
webview.isInspectable = true
516517
}
517518

519+
webview.allowsBackForwardNavigationGestures = true
520+
518521
// Avoid safe-area content insets which can leave a small gap at the bottom on iPad until a reload.
519522
webview.scrollView.contentInsetAdjustmentBehavior = .never
520523
webview.scrollView.contentInset = .zero

openHAB/UI/SwiftUI/Rows/WebRowView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ struct WebRowView: UIViewRepresentable {
143143
func makeUIView(context: Context) -> WKWebView {
144144
let homeId = Preferences.shared.currentHomePreferences.id
145145
let webView = WKWebView(frame: .zero, configuration: WebRowViewConfigurationFactory.make(homeId: homeId))
146+
webView.allowsBackForwardNavigationGestures = true
146147
webView.navigationDelegate = context.coordinator
147148
return webView
148149
}

0 commit comments

Comments
 (0)