Skip to content

Commit 7e801c3

Browse files
committed
focus voice over automatically when focussing a timeline event
1 parent b605717 commit 7e801c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ class TimelineTableViewController: UIViewController {
378378
let indexPath = dataSource?.indexPath(for: kvPair.key) {
379379
tableView.scrollToRow(at: indexPath, at: .middle, animated: animated)
380380
coordinator.send(viewAction: .scrolledToFocussedItem)
381+
// Ensure VoiceOver focus happens after the scroll animation (if any)
382+
DispatchQueue.main.asyncAfter(deadline: .now() + (animated ? 0.5 : 0.0)) {
383+
if let cell = self.tableView.cellForRow(at: indexPath) {
384+
UIAccessibility.post(notification: .layoutChanged, argument: cell)
385+
}
386+
}
381387
}
382388
}
383389
}

0 commit comments

Comments
 (0)