mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add a11y labels/hints to post editor textviews
It’s impossible to differentiate these textviews because the placeholder text is not read by VoiceOver, so we need to add labels.
This commit is contained in:
parent
7d99c8afc4
commit
608c66e543
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
@ -49,6 +49,8 @@ struct PostTextEditingView: View {
|
||||
isFirstResponder: $titleIsFirstResponder,
|
||||
lineSpacing: horizontalSizeClass == .compact ? lineSpacingMultiplier / 2 : lineSpacingMultiplier
|
||||
)
|
||||
.accessibilityLabel(Text("Title (optional)"))
|
||||
.accessibilityHint(Text("Add or edit the title for your post; use the Return key to skip to the body"))
|
||||
.frame(height: titleFieldHeight)
|
||||
.onChange(of: post.title) { _ in
|
||||
if post.status == PostStatus.published.rawValue && !updatingTitleFromServer {
|
||||
@ -73,6 +75,8 @@ struct PostTextEditingView: View {
|
||||
isFirstResponder: $bodyIsFirstResponder,
|
||||
lineSpacing: horizontalSizeClass == .compact ? lineSpacingMultiplier / 2 : lineSpacingMultiplier
|
||||
)
|
||||
.accessibilityLabel(Text("Body"))
|
||||
.accessibilityHint(Text("Add or edit the body of your post"))
|
||||
.onChange(of: post.body) { _ in
|
||||
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
|
||||
post.status = PostStatus.edited.rawValue
|
||||
|
Loading…
Reference in New Issue
Block a user