add limit lines
This commit is contained in:
parent
fa1637a5af
commit
2f8c1f3514
@ -7,6 +7,8 @@ struct PrivateChatView: View {
|
||||
let chat: PrivateChatListItem
|
||||
let currentUserId: String?
|
||||
private let bottomAnchorId = "PrivateChatBottomAnchor"
|
||||
|
||||
let lineLimitInChat = 6
|
||||
|
||||
@StateObject private var viewModel: PrivateChatViewModel
|
||||
@State private var hasPositionedToBottom: Bool = false
|
||||
@ -247,9 +249,9 @@ struct PrivateChatView: View {
|
||||
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
Group {
|
||||
if #available(iOS 160.0, *) {
|
||||
if #available(iOS 16.0, *) {
|
||||
TextField(inputTab.placeholder, text: $draftText, axis: .vertical)
|
||||
.lineLimit(1...4)
|
||||
.lineLimit(1...lineLimitInChat)
|
||||
.focused($isComposerFocused)
|
||||
.submitLabel(.send)
|
||||
.disabled(currentUserId == nil)
|
||||
@ -263,8 +265,8 @@ struct PrivateChatView: View {
|
||||
set: { isComposerFocused = $0 }
|
||||
),
|
||||
isEnabled: currentUserId != nil,
|
||||
minHeight: 40,
|
||||
maxLines: 4,
|
||||
minHeight: 10,
|
||||
maxLines: lineLimitInChat,
|
||||
calculatedHeight: $legacyComposerHeight,
|
||||
onSubmit: sendCurrentMessage
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user