diff --git a/NucleicRemote/NucleicRemote/Views/Composer.swift b/NucleicRemote/NucleicRemote/Views/Composer.swift index 80171c2..46eb6a4 100644 --- a/NucleicRemote/NucleicRemote/Views/Composer.swift +++ b/NucleicRemote/NucleicRemote/Views/Composer.swift @@ -211,6 +211,20 @@ struct NewChatAffordance: ViewModifier { .padding(.horizontal, 12) .padding(.bottom, 8) .transition(.move(edge: .bottom).combined(with: .opacity)) + // A deliberate swipe down dismisses the bar (drops the keyboard first), + // the gestural twin of tapping the scrim. minimumDistance keeps taps on + // the field / menus / send button working; the vertical-dominant check + // ignores horizontal drags (e.g. moving the text cursor). + .gesture( + DragGesture(minimumDistance: 20) + .onEnded { value in + if value.translation.height > 60, + value.translation.height > abs(value.translation.width) { + draftFocused = false + isPresented = false + } + } + ) } } }