Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep the search field's magnifier hidden from VoiceOver

Țugui Dragoșf4fa65985fcc
diff --git a/Peel/Views/ColumnSearchField.swift b/Peel/Views/ColumnSearchField.swift
index 565bc284..2cd111a5 100644
--- a/Peel/Views/ColumnSearchField.swift
+++ b/Peel/Views/ColumnSearchField.swift
@@ -32,6 +32,8 @@ struct ColumnSearchField: View {
// `searchable` marks its field as a search field; a plain text field in a drawn box isn't marked.
.accessibilityAddTraits(.isSearchField)
.accessibilityLabel(Text(prompt))
+ // One by one: `false` on the whole field would show the decorative magnifier to VoiceOver.
+ .accessibilityHidden(!isAvailable)
if !text.isEmpty {
Button {
text = ""
@@ -47,6 +49,7 @@ struct ColumnSearchField: View {
.padding(-4)
.help(Text("Clear the search"))
.accessibilityLabel(Text("Clear the search"))
+ .accessibilityHidden(!isAvailable)
}
}
.font(.body)
@@ -63,7 +66,6 @@ struct ColumnSearchField: View {
.motion(.touch, value: isFocused)
.opacity(isAvailable ? 1 : 0)
.disabled(!isAvailable)
- .accessibilityHidden(!isAvailable)
.motion(value: isAvailable)
// Read by ⌘F in the Edit menu.
.focusedSceneValue(\.searchField, isAvailable ? $isRequested : nil)