+
{title}
@@ -92,6 +114,7 @@ const renderFeedbackBody = (
{normalizedDescription && (
@@ -110,6 +133,7 @@ const renderFeedbackBody = (
: styles.feedbackTextAppearMedium)
)}
data-testid="slot"
+ aria-hidden={hideOthers}
>
{extra}
@@ -119,12 +143,16 @@ const renderFeedbackBody = (
);
};
-const renderInlineFeedbackBody = (feedbackBody: React.ReactNode, buttons: ButtonGroupProps) => {
+const renderInlineFeedbackBody = (
+ feedbackBody: React.ReactNode,
+ buttons: ButtonGroupProps,
+ shouldReadButtons: boolean
+) => {
const hasButtons = checkHasButtons(buttons);
return (
{feedbackBody}
- {hasButtons && }
+ {hasButtons && }
);
};
@@ -223,18 +251,30 @@ export const FeedbackScreen = ({
const {isTabletOrSmaller} = useScreenSize();
const hasButtons = checkHasButtons({primaryButton, secondaryButton, link});
-
- const feedbackBody = renderFeedbackBody(
- {asset, title, description, extra},
- animateText && areAnimationsSupported(platformOverrides)
+ const isAnimated = animateText && areAnimationsSupported(platformOverrides);
+ const [isShouldRead, setShouldRead] = React.useState(!isAnimated);
+
+ const feedbackBody = (
+
);
if (!isTabletOrSmaller && unstable_inlineInDesktop) {
- return renderInlineFeedbackBody(feedbackBody, {
- primaryButton,
- secondaryButton,
- link,
- });
+ return renderInlineFeedbackBody(
+ feedbackBody,
+ {
+ primaryButton,
+ secondaryButton,
+ link,
+ },
+ isShouldRead
+ );
}
return (
@@ -261,6 +301,7 @@ export const FeedbackScreen = ({
containerBgColor={
isInverse ? vars.colors.backgroundBrand : vars.colors.background
}
+ hideDivToScreenReaders={!isShouldRead}
>
@@ -385,6 +426,7 @@ export const SuccessFeedback = ({
}: AssetFeedbackProps): JSX.Element => {
useHapticFeedback('success');
const {skinName, platformOverrides} = useTheme();
+ const [isShouldRead, setShouldRead] = React.useState(false);
const asset =
skinName === VIVO_SKIN ? (
@@ -394,15 +436,25 @@ export const SuccessFeedback = ({
) : (
);
- const feedbackBody = renderFeedbackBody(
- {asset, title, description, extra},
- areAnimationsSupported(platformOverrides)
+ const feedbackBody = (
+
+ );
+ const inlineFeedbackBody = renderInlineFeedbackBody(
+ feedbackBody,
+ {
+ primaryButton,
+ secondaryButton,
+ link,
+ },
+ isShouldRead
);
- const inlineFeedbackBody = renderInlineFeedbackBody(feedbackBody, {
- primaryButton,
- secondaryButton,
- link,
- });
return renderFeedback({
isInverse: true,