From 7772783555d918481beb3c56cf9f8cbdd3d96111 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 18 Apr 2022 16:56:29 +0800 Subject: [PATCH] fix: pick sever search bar accessible a11y issue --- .../xcshareddata/xcschemes/Mastodon.xcscheme | 8 -------- .../View/PickServerServerSectionTableHeaderView.swift | 6 +++--- .../MastodonUI/View/TableViewCell/NewsTableViewCell.swift | 5 +++++ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Mastodon.xcodeproj/xcshareddata/xcschemes/Mastodon.xcscheme b/Mastodon.xcodeproj/xcshareddata/xcschemes/Mastodon.xcscheme index 048ce3cf..488d5a2d 100644 --- a/Mastodon.xcodeproj/xcshareddata/xcschemes/Mastodon.xcscheme +++ b/Mastodon.xcodeproj/xcshareddata/xcschemes/Mastodon.xcscheme @@ -73,7 +73,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - enableAddressSanitizer = "YES" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" @@ -90,13 +89,6 @@ ReferencedContainer = "container:Mastodon.xcodeproj"> - - - - Int { guard let diffableDataSource = diffableDataSource else { return 0 } - return diffableDataSource.snapshot().itemIdentifiers.count + return diffableDataSource.snapshot().itemIdentifiers.count + 1 } override func accessibilityElement(at index: Int) -> Any? { - guard let item = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) else { return nil } - return item + if let item = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) { return item } + return searchTextField } } diff --git a/MastodonSDK/Sources/MastodonUI/View/TableViewCell/NewsTableViewCell.swift b/MastodonSDK/Sources/MastodonUI/View/TableViewCell/NewsTableViewCell.swift index 3515000f..f0b2aec8 100644 --- a/MastodonSDK/Sources/MastodonUI/View/TableViewCell/NewsTableViewCell.swift +++ b/MastodonSDK/Sources/MastodonUI/View/TableViewCell/NewsTableViewCell.swift @@ -51,6 +51,11 @@ extension NewsTableViewCell { separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)), ]) + + isAccessibilityElement = true + accessibilityElements = [ + newsView + ] } }