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

fix: [IOBP-1179] a11y banner focus order #6725

Merged
merged 4 commits into from
Feb 17, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
"@babel/plugin-transform-react-jsx": "^7.25.9",
"@gorhom/bottom-sheet": "^4.1.5",
"@pagopa/io-app-design-system": "4.5.5",
"@pagopa/io-app-design-system": "4.5.6",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-cieid": "^0.3.5",
"@pagopa/io-react-native-crypto": "^1.0.1",
Expand Down
29 changes: 7 additions & 22 deletions ts/features/design-system/core/DSSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
NativeSwitch,
RadioGroup,
RadioItem,
SwitchLabel,
VStack,
useIOTheme
} from "@pagopa/io-app-design-system";
Expand Down Expand Up @@ -62,8 +61,6 @@ export const DSSelection = () => {
<NativeSwitchShowroom />
{/* ListItemSwitch */}
<ListItemSwitchShowroom />
{/* SwitchLabel */}
{renderAnimatedSwitch()}
</VStack>
</VStack>
</VStack>
Expand Down Expand Up @@ -308,29 +305,17 @@ const AnimatedMessageCheckboxShowroom = () => {
const toggleSwitch = () => setIsEnabled(previousState => !previousState);

return (
<>
<DSComponentViewerBox name="AnimatedMessageCheckbox">
<View style={[IOStyles.row, IOStyles.alignCenter]}>
<AnimatedMessageCheckbox checked={isEnabled} />
<HSpacer size={24} />
<NativeSwitch onValueChange={toggleSwitch} value={isEnabled} />
</View>
</DSComponentViewerBox>
</>
<DSComponentViewerBox name="AnimatedMessageCheckbox">
<View style={[IOStyles.row, IOStyles.alignCenter]}>
<AnimatedMessageCheckbox checked={isEnabled} />
<HSpacer size={24} />
<NativeSwitch onValueChange={toggleSwitch} value={isEnabled} />
</View>
</DSComponentViewerBox>
);
};

// SWITCH

const renderAnimatedSwitch = () => (
<DSComponentViewerBox name="AnimatedSwitch, dismissed in favor of the native one">
<VStack space={componentInnerMargin}>
<SwitchLabel label="This is a test" />
<SwitchLabel label="This is a test with a very loooong looooooong loooooooong text" />
</VStack>
</DSComponentViewerBox>
);

const NativeSwitchShowroom = () => {
const [isEnabled, setIsEnabled] = useState(false);
const toggleSwitch = () => setIsEnabled(previousState => !previousState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,36 @@ exports[`ItwFeedbackBanner should match the snapshot 1`] = `
accessibilityElementsHidden={true}
accessibilityLabel="Inizia"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,36 @@ exports[`ItwDiscoveryBanner should match snapshot 1`] = `
accessibilityElementsHidden={true}
accessibilityLabel="Inizia"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,36 @@ exports[`ItwDiscoveryBannerOnboarding should match snapshot when isItwDiscoveryB
accessibilityElementsHidden={true}
accessibilityLabel="Inizia"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,36 @@ exports[`ItwDiscoveryBannerStandalone should match snapshot when isItwDiscoveryB
accessibilityElementsHidden={true}
accessibilityLabel="Inizia"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,36 @@ exports[`RemoteContentBanner Should match snapshot 1`] = `
accessibilityElementsHidden={true}
accessibilityLabel="Learn more"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,36 @@ exports[`PushNotificationsBanner should render correctly and call 'trackPushNoti
accessibilityElementsHidden={true}
accessibilityLabel="Turn on push notifications"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2439,8 +2439,36 @@ exports[`LandingScreen Should match the snapshot 1`] = `
accessibilityElementsHidden={true}
accessibilityLabel="We give you a hand"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,36 @@ exports[`ProfileMainScreenTopBanner should match snapshot for all possible resul
accessibilityElementsHidden={true}
accessibilityLabel="Go to "Your data" section"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,36 @@ exports[`settingsDiscoveryBanner should match snapshot 1`] = `
accessibilityElementsHidden={true}
accessibilityLabel="Go to Settings"
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
importantForAccessibility="no-hide-descendants"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
pointerEvents="none"
>
<View
Expand Down
Loading
Loading