-
Notifications
You must be signed in to change notification settings - Fork 2
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-403] Action in banner is not announced by screen reader on Android #342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RiccardoMolinari95,
I read the description, but something doesn't click in my brain.
First of all, two things:
renderMainBlock
is used in both the static and interactive versions, but from what I can see we're also editing the behaviour of the static one- Why can't we generate the complete accessibility label by checking if action is present?
Assuming I'm right, this is what I'm proposing:
- Remove the
actionAccessibility
prop by dynamically generating the fallbackaccessibilityLabel
based on the presence/absence of theaction
prop - Rename
completeAccessibilityLabel
tofallbackAccessibilityLabel
- Change the statement in the
renderMainBlock
toaccessibilityLabel ?? fallbackAccessibilityLabel
, so that if we don't provide a validaccessibilityLabel
, the component will use the generated fallback.
What do you think?
Hi @dmnplb, yes you’re right! Removing |
…ided use fallbackAccessibilityLabel
…ub.com/pagopa/io-app-design-system into IOAPPX-403-action-banner-accessibility
Short description
This PR resolves an accessibility issue where the
action
in theBanner
component was not properly announced by Screen Readers on Android devices. The changes introduced propose a solution while ensuring that existing functionality remains unaffectedList of changes proposed in this pull request
fallbackAccessibilityLabel
, a dynamically generated label combining thetitle
,content
, andaction
if they are present.accessibilityLabel
is not provided,fallbackAccessibilityLabel
is used as a defaultHow to test
To test the changes, import the updated library containing the modifications into the IO app and ensure that the Screen Reader announces the title, content, and action accurately, even when one of these elements is missing.
Warning: This solution has been tested on an Android device and on an iOS simulator. Remains to be tested on iOS device