From fc75b50d7fe1581abbeb3599612c9d4a18cbea4d Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 26 Feb 2025 00:20:02 -0500 Subject: [PATCH] Fix Compose toolbar not showing on iOS 15 --- .../Sources/ComposeUI/Views/ComposeView.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeView.swift b/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeView.swift index 68b60969..36da180f 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeView.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeView.swift @@ -157,8 +157,17 @@ private struct ComposeViewBody: View { .overlay(alignment: .bottom, content: { // This needs to be in an overlay, ignoring the keyboard safe area // doesn't work with the safeAreaInset modifier. + + // When we're using the input accessory toolbar, hide the overlay toolbar so that, + // on iPad, we don't get two toolbars showing. + let showOverlayToolbar = if #available(iOS 16.0, *) { + focusedField == nil + } else { + true + } + if config.showToolbar, - focusedField == nil { + showOverlayToolbar { toolbarView .frame(maxHeight: .infinity, alignment: .bottom) .modifier(IgnoreKeyboardSafeAreaIfUsingInputAccessory())