Fix voiceover order of room creation header and message composer.

This commit is contained in:
Doug
2023-05-09 19:12:30 +01:00
committed by Doug
parent 05f89f1160
commit 7d3efda5ef
4 changed files with 25 additions and 0 deletions
@@ -70,6 +70,8 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
_sendMode = RoomInputToolbarViewSendModeSend;
self.inputContextViewHeightConstraint.constant = 0;
self.inputContextLabel.isAccessibilityElement = NO;
self.inputContextButton.isAccessibilityElement = NO;
[self.rightInputToolbarButton setTitle:nil forState:UIControlStateNormal];
[self.rightInputToolbarButton setTitle:nil forState:UIControlStateHighlighted];
@@ -252,6 +254,10 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
break;
}
// Hide the context items from VoiceOver when the context view is "hidden".
self.inputContextLabel.isAccessibilityElement = self.inputContextViewHeightConstraint.constant > 0;
self.inputContextButton.isAccessibilityElement = self.inputContextViewHeightConstraint.constant > 0;
[self.rightInputToolbarButton setImage:buttonImage forState:UIControlStateNormal];
if (self.maxHeight && updatedHeight > self.maxHeight)
@@ -477,11 +483,22 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
[self.mainToolbarView.leftAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.leftAnchor],
[self.mainToolbarView.bottomAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.bottomAnchor],
[self.mainToolbarView.rightAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.rightAnchor]]];
// The voice message toolbar is taller than the input toolbar so the record button is read
// out before the other subviews. Fix this by manually adding the elements in the right order.
self.accessibilityElements = @[self.attachMediaButton,
self.actionsBar,
self.inputContextLabel,
self.inputContextButton,
self.textView,
self.rightInputToolbarButton,
self.voiceMessageToolbarView];
}
else
{
[self.voiceMessageToolbarView removeFromSuperview];
_voiceMessageToolbarView = nil;
self.accessibilityElements = nil;
}
}
@end