Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOAPPX-443] Restore a11y props in the Banner component #364

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/components/banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
PictogramBleed
} from "../pictograms";
import { VSpacer } from "../spacer";
import { buttonTextFontSize, H6, IOText, BodySmall } from "../typography";
import { BodySmall, buttonTextFontSize, H6, IOText } from "../typography";

/* Styles */
const sizePictogramBig: IOPictogramSizeScale = 80;
Expand Down Expand Up @@ -249,20 +249,27 @@ export const Banner = ({
)}
{action && (
/* Disable pointer events to avoid
pressed state on the button */
pressed state on the button */
<View
pointerEvents="none"
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"
accessible={true}
accessibilityElementsHidden
accessibilityLabel={action}
accessibilityRole="button"
>
<VSpacer size={4} />
<IOText
font={isExperimental ? "Titillio" : "TitilliumSansPro"}
weight={isExperimental ? "Regular" : "Bold"}
weight="Semibold"
color={colorMainButton}
size={buttonTextFontSize}
numberOfLines={1}
ellipsizeMode="tail"
// A11y
accessible={false}
importantForAccessibility="no-hide-descendants"
accessibilityElementsHidden={true}
>
{action}
</IOText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
/>
<View
accessibilityElementsHidden={true}
accessibilityLabel="Action text"
accessibilityRole="button"
accessible={true}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
>
Expand All @@ -112,8 +115,11 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
}
/>
<Text
accessibilityElementsHidden={true}
accessible={false}
allowFontScaling={true}
ellipsizeMode="tail"
importantForAccessibility="no-hide-descendants"
maxFontSizeMultiplier={1.25}
numberOfLines={1}
style={
Expand All @@ -124,7 +130,7 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
"fontFamily": "Titillio",
"fontSize": 16,
"fontStyle": "normal",
"fontWeight": "400",
"fontWeight": "600",
"lineHeight": undefined,
},
]
Expand Down Expand Up @@ -374,6 +380,9 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
/>
<View
accessibilityElementsHidden={true}
accessibilityLabel="Action text"
accessibilityRole="button"
accessible={true}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
>
Expand All @@ -385,8 +394,11 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
}
/>
<Text
accessibilityElementsHidden={true}
accessible={false}
allowFontScaling={false}
ellipsizeMode="tail"
importantForAccessibility="no-hide-descendants"
maxFontSizeMultiplier={1.25}
numberOfLines={1}
style={
Expand All @@ -397,7 +409,7 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
"fontFamily": "Titillium Sans Pro",
"fontSize": 16,
"fontStyle": "normal",
"fontWeight": "700",
"fontWeight": "600",
"lineHeight": undefined,
},
]
Expand Down