Fix crash when scrolling through Local/Federated timeline with VoiceOver

It seems that the accessibility scroll mechanism does something like:
1. Find the next IndexPath to focus
2. Scroll to make it visible
3. Focus that cell

But because the timeline description cell is removed during the scroll,
the IndexPath that the accessibility system wants to focus becomes
invalid between steps 2 and 3, causing a crash when trying to focus it.

As a workaround, only remove the timeline description _item_ rather than
the header section so that section indices aren't affected.

Closes #290
This commit is contained in:
Shadowfacts 2022-12-06 21:46:32 -05:00
parent ffb5c76f7c
commit 57668886b2
1 changed files with 1 additions and 1 deletions

View File

@ -345,7 +345,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
private func removeTimelineDescriptionCell() {
var snapshot = dataSource.snapshot()
snapshot.deleteSections([.header])
snapshot.deleteItems([.publicTimelineDescription])
dataSource.apply(snapshot, animatingDifferences: true)
isShowingTimelineDescription = false
}