Tab Bar Load Animation
Nucleic-Session: EEC60FAE-8368-49CA-9202-7026C12E7F8C Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user