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.
This commit is contained in:
Angelo Stavrow 2020-12-30 10:39:48 -05:00
parent 69cd86c1da
commit 34c2cd181e
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -117,8 +117,19 @@ struct PostEditorView: View {
} }
} }
}, label: { }, 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()
}
} }
} }
} }