Keep hidden QuickLook chrome out of VoiceOver focus order

The media upload preview hides the QLPreviewController's navigation bar and
toolbar share button visually, but their buttons stayed in VoiceOver's focus
order. Mark the chrome as accessibility-hidden so it is no longer focusable.

Addresses #5266, #5267.
This commit is contained in:
Mauro Romito
2026-06-19 12:32:28 +02:00
committed by Mauro
parent fbbdb6f5f7
commit 17da5ff3b7
@@ -316,6 +316,11 @@ private class PreviewViewController: QLPreviewController {
// Hide toolbar share button
toolbarItems?.first?.isHidden = true
// The chrome is hidden visually but its buttons remain in VoiceOver's focus order,
// so keep the navigation bar and toolbar out of the accessibility tree too.
navigationController?.navigationBar.accessibilityElementsHidden = true
navigationController?.toolbar?.accessibilityElementsHidden = true
}
}