From 6653dcf6f64750d351b54df2a3bd0e94c08c615d Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 16 Jun 2025 17:03:36 +0200 Subject: [PATCH] focus voice over automatically when focussing a timeline event --- .../Screens/Timeline/TimelineTableViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift index 1b1b9a946..b5986cc8d 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift @@ -378,6 +378,12 @@ class TimelineTableViewController: UIViewController { let indexPath = dataSource?.indexPath(for: kvPair.key) { tableView.scrollToRow(at: indexPath, at: .middle, animated: animated) coordinator.send(viewAction: .scrolledToFocussedItem) + // Ensure VoiceOver focus happens after the scroll animation (if any) + DispatchQueue.main.asyncAfter(deadline: .now() + (animated ? 0.5 : 0.0)) { + if let cell = self.tableView.cellForRow(at: indexPath) { + UIAccessibility.post(notification: .layoutChanged, argument: cell) + } + } } } }