From 38312b74733e5ca212893413978e8e685b7d496b Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 1 Oct 2026 13:46:20 +0300 Subject: [PATCH] Fix the search tab's layout now that its built against os27 --- .../Navigation/NavigationTabCoordinator.swift | 1 + ElementX/Sources/Other/SwiftUI/Backports.swift | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift index 30e00fa71..8519dd1b6 100644 --- a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift +++ b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift @@ -409,6 +409,7 @@ private struct NavigationTabCoordinatorView: View { } } .backportTabBarMinimizeBehaviorOnScrollDown() + .backportTabViewSearchActivationOnSearchTabSelection() .introspect(.tabView, on: .supportedVersions, customize: configureAppearance) } diff --git a/ElementX/Sources/Other/SwiftUI/Backports.swift b/ElementX/Sources/Other/SwiftUI/Backports.swift index 15c913947..8493a18d2 100644 --- a/ElementX/Sources/Other/SwiftUI/Backports.swift +++ b/ElementX/Sources/Other/SwiftUI/Backports.swift @@ -20,6 +20,15 @@ extension View { } } + /// iOS 27 only detaches the search tab and docks its field at the bottom when selecting the tab activates search. + @ViewBuilder func backportTabViewSearchActivationOnSearchTabSelection() -> some View { + if #available(iOS 27.0, *) { + tabViewSearchActivation(.searchTabSelection) + } else { + self + } + } + @ViewBuilder func backportSafeAreaBar(edge: VerticalEdge, alignment: HorizontalAlignment = .center,