-
Notifications
You must be signed in to change notification settings - Fork 166
[Terra-Tag] SR announces instructions twice with VPC ON Mode #3978
Conversation
@@ -74,7 +74,7 @@ const RollUpTag = (props) => { | |||
onBlur={handleOnBlur} | |||
refCallback={(ref) => { rollUpTagRef.current = ref; }} | |||
isCompact | |||
aria-live={(isCollapsed) ? 'polite' : 'off'} | |||
aria-live={(navigator.userAgent.indexOf('Edg') === -1 && isCollapsed && !/^(?=.*\bSafari\b)(?!.*\bChrome\b).*/i.test(navigator.userAgent)) ? 'polite' : 'off'} |
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.
aria-live is now used only when its either safari or chrome ? Can the expression be simplified ?
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.
@gt106551 What does this expression validate to ..??
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.
I have tried to simplify in different ways but getting issues in safari browser
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.
@gt106551 What does this expression validate to ..??
it checks if the user agent string contains 'Safari' but does not contain 'Chrome'.
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.
If you need only safari, refer :
if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { |
Include edge as well in this
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.
I think you're trying to set aria-live to polite
for edge and JAWS. In this case you can refer to some of the existing regEx for edge browser instead of adding new expression from web.
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.
I Have removed aria-live attribute and tested in all browsers it is working as expected.
Summary
Fixed-SR announces instructions twice with VPC ON Mode
What was changed:
Removed the
aria-live
property to prevent JAWS (screen reader) from announcing twice in the Edge browser.Why it was changed:
When VPC is in ON mode, screen reader announces instruction "11 items are hidden" twice .
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9812
Thank you for contributing to Terra.
@cerner/terra