From 34c2cd181e7af597dc465a1f3c4cd1ed5b67e750 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 30 Dec 2020 10:39:48 -0500 Subject: [PATCH] Add a11y features to post editor context menu Adding an .onTapGesture modifier here to dismiss the keyboard removes focus from whatever textview is active in the post editor, which prevents VoiceOver from getting confused about which accessibility frame should be read. --- iOS/PostEditor/PostEditorView.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/iOS/PostEditor/PostEditorView.swift b/iOS/PostEditor/PostEditorView.swift index e5dfbd7..3421fc4 100644 --- a/iOS/PostEditor/PostEditorView.swift +++ b/iOS/PostEditor/PostEditorView.swift @@ -117,8 +117,19 @@ struct PostEditorView: View { } } }, label: { - Image(systemName: "ellipsis.circle") + ZStack { + Image("does.not.exist") + .accessibilityHidden(true) + Image(systemName: "ellipsis.circle") + .imageScale(.large) + .accessibilityHidden(true) + } }) + .accessibilityLabel(Text("Menu")) + .accessibilityHint(Text("Opens a context menu to publish, share, or move the post")) + .onTapGesture { + hideKeyboard() + } } } }