Skip to content

Commit 5137871

Browse files
authored
Wrap thumbnails in nav tag to get proper ARIA role (#663)
While running an accessibility test on a project using this package we found the following error: `aria-label attribute is not well supported on a div with no valid role attribute`. You could simply add a `role="navigation"` to the div, but changing the `div` to `nav` will do that and be more semantically correct.
1 parent 4d2fc70 commit 5137871

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageGallery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,14 +1429,14 @@ class ImageGallery extends React.Component {
14291429
onSwiped={!disableThumbnailSwipe && this.handleOnThumbnailSwiped}
14301430
>
14311431
<div className="image-gallery-thumbnails" ref={this.thumbnailsWrapper} style={this.getThumbnailBarHeight()}>
1432-
<div
1432+
<nav
14331433
ref={this.thumbnails}
14341434
className="image-gallery-thumbnails-container"
14351435
style={thumbnailStyle}
14361436
aria-label="Thumbnail Navigation"
14371437
>
14381438
{thumbnails}
1439-
</div>
1439+
</nav>
14401440
</div>
14411441
</SwipeWrapper>
14421442
) : null

0 commit comments

Comments
 (0)