Merge branch 'mbruce/bugfixes' into 'develop'

ONEAPP-4684 - Acessibility - Tooltip

See merge request BPHV_MIPS/vds_ios!120
This commit is contained in:
Bruce, Matt R 2023-10-10 19:43:14 +00:00
commit 895c309c17
6 changed files with 25 additions and 17 deletions

View File

@ -1175,7 +1175,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 44;
CURRENT_PROJECT_VERSION = 46;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
@ -1212,7 +1212,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 44;
CURRENT_PROJECT_VERSION = 46;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -130,16 +130,15 @@ open class Tooltip: Control, TooltipLaunchable {
isAccessibilityElement = true
accessibilityTraits = .button
onClickSubscriber = publisher(for: .touchUpInside)
.sink(receiveValue: { [weak self] tooltip in
guard let self else { return}
self.presentTooltip(surface: tooltip.surface,
tooltipModel: .init(closeButtonText: tooltip.closeButtonText,
title: tooltip.title,
content: tooltip.content,
contentView: tooltip.contentView),
presenter: self)
})
onClick = { [weak self] tooltip in
guard let self else { return}
self.presentTooltip(surface: tooltip.surface,
tooltipModel: .init(closeButtonText: tooltip.closeButtonText,
title: tooltip.title,
content: tooltip.content,
contentView: tooltip.contentView),
presenter: self)
}
}
/// Resets to default settings.
@ -180,7 +179,6 @@ open class Tooltip: Control, TooltipLaunchable {
accessibilityLabel = "Modal"
}
accessibilityHint = isEnabled ? "Double tap to open." : ""
accessibilityValue = "collapsed"
}
public static func accessibleText(for title: String?, content: String?, closeButtonText: String) -> String {

View File

@ -67,14 +67,14 @@ open class TooltipAlertViewController: UIViewController, Surfaceable {
//left-right swipe
view.publisher(for: UISwipeGestureRecognizer().with{ $0.direction = .right })
.sink { [weak self] swipe in
guard let self else { return }
guard let self, !UIAccessibility.isVoiceOverRunning else { return }
self.dismiss()
}.store(in: &subscribers)
//tapping in background
view.publisher(for: UITapGestureRecognizer().with{ $0.numberOfTapsRequired = 1 })
.sink { [weak self] swipe in
guard let self else { return }
guard let self, !UIAccessibility.isVoiceOverRunning else { return }
self.dismiss()
}.store(in: &subscribers)

View File

@ -48,7 +48,6 @@ open class TooltipDialog: View, UIScrollViewDelegate {
lazy var primaryAccessibilityElement = UIAccessibilityElement(accessibilityContainer: self).with {
$0.accessibilityLabel = "Modal"
$0.accessibilityValue = "expanded"
$0.accessibilityFrameInContainerSpace = .init(origin: .zero, size: .init(width: fullWidth, height: VDSLayout.Spacing.space1X.value))
}
@ -59,6 +58,7 @@ open class TooltipDialog: View, UIScrollViewDelegate {
open var titleLabel = Label().with { label in
label.isAccessibilityElement = true
label.accessibilityTraits = .header
label.textStyle = .boldTitleMedium
}

View File

@ -22,7 +22,8 @@ extension Clickable {
set {
if let newValue {
onClickSubscriber = publisher(for: .touchUpInside)
.sink { c in
.sink { [weak self] c in
guard let self, self.isEnabled else { return }
newValue(c)
}
} else {

View File

@ -1,3 +1,12 @@
1.0.46
=======
- ONEAPP-4828 - Accessibility - Toggle
- ONEAPP-4684 - Accessibility - Tooltip
1.0.45
=======
- ONEAPP-4684 - Acessibility - Tooltip
1.0.44
=======
- ONEAPP-5109 - Typography/Label - Accessibility iOS