Skip to content

Commit

Permalink
Add initial height to avoid overlapping text while loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceylo committed Jan 23, 2023
1 parent 0e47f23 commit 9054c0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion FurAffinity/Helper Views/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import SwiftUI
struct TextView: View {
var text: AttributedString

@State private var height: CGFloat = 0
@State private var height: CGFloat

init(text: AttributedString, initialHeight: CGFloat = 0) {
self.text = text
self._height = State(initialValue: initialHeight)
}

var body: some View {
GeometryReader { geometry in
Expand Down
2 changes: 1 addition & 1 deletion FurAffinity/Submissions/SubmissionCommentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct SubmissionCommentView: View {
.foregroundColor(.secondary)
}
htmlMessage.flatMap {
TextView(text: $0)
TextView(text: $0, initialHeight: 32)
.padding(.vertical, -5)
.zIndex(-1)
}
Expand Down
2 changes: 1 addition & 1 deletion FurAffinity/Submissions/SubmissionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct SubmissionView: View {
)

if let description = description {
TextView(text: description)
TextView(text: description, initialHeight: 300)
}

SubmissionCommentsView(
Expand Down

0 comments on commit 9054c0a

Please sign in to comment.