fix: pick sever search bar accessible a11y issue

This commit is contained in:
CMK 2022-04-18 16:56:29 +08:00
parent 41e1b75c62
commit 7772783555
3 changed files with 8 additions and 11 deletions

View File

@ -73,7 +73,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
@ -90,13 +89,6 @@
ReferencedContainer = "container:Mastodon.xcodeproj"> ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"

View File

@ -185,12 +185,12 @@ extension PickServerServerSectionTableHeaderView {
override func accessibilityElementCount() -> Int { override func accessibilityElementCount() -> Int {
guard let diffableDataSource = diffableDataSource else { return 0 } 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? { override func accessibilityElement(at index: Int) -> Any? {
guard let item = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) else { return nil } if let item = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) { return item }
return item return searchTextField
} }
} }

View File

@ -51,6 +51,11 @@ extension NewsTableViewCell {
separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)), separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)),
]) ])
isAccessibilityElement = true
accessibilityElements = [
newsView
]
} }
} }