Skip to content

Commit 8ef904c

Browse files
authored
[A11Y] - fix tab index issues on fullscreen (#1350)
* [A11Y] - fix tab index issues on fullscreen * fix lint
1 parent 0cfbb02 commit 8ef904c

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

packages/gallery/src/components/gallery/proGallery/navigationArrows.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export function NavigationArrows({
115115
next,
116116
directionIsLeft,
117117
arrowsBaseClasses,
118-
tabIndex: utils.getTabIndex.bind(utils),
119118
containerStyle,
120119
prevContainerStyle,
121120
nextContainerStyle,
@@ -168,7 +167,6 @@ export function ArrowButton({
168167
directionIsLeft,
169168
renderArrowSvg,
170169
next,
171-
tabIndex,
172170
arrowBoxStyle,
173171
navArrowsContainerWidth,
174172
navArrowsContainerHeight,
@@ -180,7 +178,7 @@ export function ArrowButton({
180178
className: arrowsBaseClasses.join(' '),
181179
onClick: () => setTimeout(nextAction, 0),
182180
['aria-label']: `${isNext ? 'Next' : 'Previous'} Item`,
183-
tabIndex: tabIndex(isNext ? 'slideshowNext' : 'slideshowPrev'),
181+
tabIndex: '-1',
184182
key: !isNext ? 'nav-arrow-back' : 'nav-arrow-next',
185183
['data-hook']: !isNext ? 'nav-arrow-back' : 'nav-arrow-next',
186184
style: {

packages/gallery/src/components/item/itemView.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class ItemView extends React.Component {
5353
this.getItemAriaLabel = this.getItemAriaLabel.bind(this);
5454
this.getItemContainerClass = this.getItemContainerClass.bind(this);
5555
this.getItemWrapperClass = this.getItemWrapperClass.bind(this);
56-
this.getItemContainerTabIndex = this.getItemContainerTabIndex.bind(this);
5756
this.isIconTag = this.isIconTag.bind(this);
5857
this.onMouseEnter = this.onMouseEnter.bind(this);
5958
this.onMouseLeave = this.onMouseLeave.bind(this);
@@ -864,15 +863,6 @@ class ItemView extends React.Component {
864863
return classes.join(' ');
865864
}
866865

867-
getItemContainerTabIndex() {
868-
const tabIndex = this.isHighlight()
869-
? utils.getTabIndex('currentThumbnail')
870-
: this.props.activeIndex === this.props.idx
871-
? utils.getTabIndex('currentGalleryItem')
872-
: -1;
873-
return tabIndex;
874-
}
875-
876866
//-----------------------------------------| REACT |--------------------------------------------//
877867

878868
componentDidMount() {
@@ -969,7 +959,7 @@ class ItemView extends React.Component {
969959
onMouseLeave={this.onMouseLeave}
970960
onFocus={this.onFocus}
971961
onBlur={this.onBlur} // The onblur event is the opposite of the onfocus event.
972-
tabIndex={this.getItemContainerTabIndex()}
962+
tabIndex="-1"
973963
aria-label={this.getItemAriaLabel()}
974964
data-hash={hash}
975965
data-id={photoId}

0 commit comments

Comments
 (0)