Work around the hang due to infinite layout shifts

This commit is contained in:
Jed Fox 2023-02-09 11:25:50 -05:00
parent 065906c3d1
commit f39812c80d
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
2 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ extension ComposeContentViewModel {
$contentCellFrame
.map { $0.height }
.removeDuplicates()
.throttle(for: 0.5, scheduler: RunLoop.main, latest: true)
.sink { [weak self] height in
guard let self = self else { return }
guard !tableView.visibleCells.isEmpty else { return }

View File

@ -83,6 +83,7 @@ public struct ComposeContentView: View {
authorView
.padding(.top, 14)
.padding(.horizontal, ComposeContentView.margin)
.fixedSize(horizontal: false, vertical: true)
// content editor
MetaTextViewRepresentable(
string: $viewModel.content,