Skip to content

Commit

Permalink
microsoft#3814 Add tabindex and focus indicator to carousel children
Browse files Browse the repository at this point in the history
  • Loading branch information
corinagum committed Apr 9, 2021
1 parent 0eada8e commit 5d6c134
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/component/src/Activity/CarouselFilmStrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ const CarouselFilmStrip = ({

return (
<div
aria-labelledby={ariaLabelId}
className={classNames(
'webchat__carousel-filmstrip',
{
Expand Down Expand Up @@ -236,11 +235,13 @@ const CarouselFilmStrip = ({
/* eslint-disable-next-line react/no-array-index-key */
key={index}
role="listitem"
tabIndex={0}
>
<ScreenReaderText text={attachedAlt} />
{/* eslint-disable-next-line react/no-array-index-key */}
<Bubble fromUser={fromUser} key={index} nub={false}>
{renderAttachment({ activity, attachment })}
<div className="webchat__carousel-filmstrip__attachment__focus-indicator" />
</Bubble>
</li>
))}
Expand Down
18 changes: 18 additions & 0 deletions packages/component/src/Styles/StyleSet/CarouselFilmStrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default function CarouselFilmStrip({
bubbleMaxWidth,
bubbleMinWidth,
paddingRegular,
transcriptVisualKeyboardIndicatorColor,
transcriptVisualKeyboardIndicatorStyle,
transcriptVisualKeyboardIndicatorWidth,
transitionDuration
}: StrictStyleOptions) {
return {
Expand All @@ -19,6 +22,21 @@ export default function CarouselFilmStrip({
},

'& .webchat__carousel-filmstrip__attachment': {
'&:focus': {
outline: 0
},
'&:focus .webchat__carousel-filmstrip__attachment__focus-indicator': {
borderColor: transcriptVisualKeyboardIndicatorColor,
borderStyle: transcriptVisualKeyboardIndicatorStyle,
borderWidth: transcriptVisualKeyboardIndicatorWidth,
boxSizing: 'border-box',
height: `calc(100% - ${transcriptVisualKeyboardIndicatorWidth}px)`,
left: '0',
pointerEvents: 'none',
position: 'absolute',
top: 0,
width: `calc(100% - ${transcriptVisualKeyboardIndicatorWidth}px)`
},
minWidth: bubbleMinWidth,
maxWidth: bubbleMaxWidth,
transitionDuration,
Expand Down

0 comments on commit 5d6c134

Please sign in to comment.