Skip to content

Commit 4972450

Browse files
Gauthier AmbardChromium LUCI CQ
Gauthier Ambard
authored and
Chromium LUCI CQ
committed
[124][iOS] Reset layout when activating voice over
VoiceOver scroll ability comes from a special handling of the layout when VoiceOver is activated. Invalidate the layout when voice over is turned on/off to make sure the layout is correct. (cherry picked from commit c16a454) Fixed: 330856099 Change-Id: I1024de47dfa5030124eef29f335d3865946e8979 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5385657 Commit-Queue: Gauthier Ambard <gambard@chromium.org> Auto-Submit: Gauthier Ambard <gambard@chromium.org> Commit-Queue: Ewann Pellé <ewannpv@chromium.org> Reviewed-by: Ewann Pellé <ewannpv@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1276830} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5385330 Cr-Commit-Position: refs/branch-heads/6367@{#203} Cr-Branched-From: d158c6d-refs/heads/main@{#1274542}
1 parent 8bf0d5b commit 4972450

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ios/chrome/browser/ui/tab_switcher/tab_strip/ui/tab_strip_layout.swift

+9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class TabStripLayout: UICollectionViewFlowLayout {
4747
left: TabStripConstants.CollectionView.horizontalInset,
4848
bottom: 0,
4949
right: TabStripConstants.CollectionView.horizontalInset)
50+
51+
NotificationCenter.default.addObserver(
52+
self, selector: #selector(voiceOverChanged),
53+
name: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil)
5054
}
5155

5256
required init?(coder: NSCoder) {
@@ -565,6 +569,11 @@ class TabStripLayout: UICollectionViewFlowLayout {
565569
return alpha
566570
}
567571

572+
// Called when voice over is activated.
573+
@objc func voiceOverChanged() {
574+
self.invalidateLayout()
575+
}
576+
568577
// MARK: - Public
569578

570579
// Calculates the dynamic size of a tab according to the number of tabs and

0 commit comments

Comments
 (0)