diff --git a/change/@azure-communication-react-6e1bc4ff-739c-4151-820d-566d6a32d76e.json b/change/@azure-communication-react-6e1bc4ff-739c-4151-820d-566d6a32d76e.json new file mode 100644 index 00000000000..828a2d2067b --- /dev/null +++ b/change/@azure-communication-react-6e1bc4ff-739c-4151-820d-566d6a32d76e.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "A11y", + "comment": "Fix focus moving out of ReactionButton flyout when navigating with Tab key", + "packageName": "@azure/communication-react", + "email": "miguelgamis@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@azure-communication-react-f5a8e707-2efe-49a9-bbea-2d08346fc9f8.json b/change/@azure-communication-react-f5a8e707-2efe-49a9-bbea-2d08346fc9f8.json new file mode 100644 index 00000000000..d30974a5774 --- /dev/null +++ b/change/@azure-communication-react-f5a8e707-2efe-49a9-bbea-2d08346fc9f8.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "A11y", + "comment": "Screen reader announcing position information for the emoji buttons", + "packageName": "@azure/communication-react", + "email": "miguelgamis@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/src/components/ReactionButton.tsx b/packages/react-components/src/components/ReactionButton.tsx index 1cdea82fde4..d5b488160d3 100644 --- a/packages/react-components/src/components/ReactionButton.tsx +++ b/packages/react-components/src/components/ReactionButton.tsx @@ -5,7 +5,7 @@ import { Callout, concatStyleSets, DefaultButton, - FocusZone, + FocusTrapZone, IButton, ICalloutContentStyles, mergeStyles, @@ -27,7 +27,6 @@ import { import { isDarkThemed } from '../theming/themeUtils'; import { ReactionResources } from '..'; import { getEmojiFrameCount } from './VideoGallery/utils/videoGalleryLayoutUtils'; -import { _preventDismissOnEvent } from '@internal/acs-ui-common'; /** * Reactions types for the Reaction button @@ -138,8 +137,21 @@ export const ReactionButton = (props: ReactionButtonProps): JSX.Element => { setCalloutIsVisible(false); }} > - - + { + if (e.key === 'Escape') { + e.preventDefault(); + e.stopPropagation(); + reactionButtonRef.current?.focus(); + setCalloutIsVisible(false); + } + }} + style={{ height: '100%' }} + > + {emojis.map((emoji, index) => { const resourceUrl = emojiResource.get(emoji); const frameCount: number = @@ -153,7 +165,6 @@ export const ReactionButton = (props: ReactionButtonProps): JSX.Element => { content={emojiButtonTooltip.get(emoji)} styles={reactionToolTipHostStyle()} calloutProps={{ ...calloutProps }} - role="listitem" > { }} className={classname} styles={reactionItemButtonStyles} - aria-label={emojiButtonTooltip.get(emoji)} - aria-setsize={emojis.length} - aria-posinset={index + 1} + aria-label={`${emojiButtonTooltip.get(emoji)}, ${index + 1} of ${emojis.length}`} > ); })} - + )}