Skip to content

Commit

Permalink
Merge pull request #8 from kunai-consulting/COD-1944
Browse files Browse the repository at this point in the history
COD-1944 - Add screenreader capabilities to thumbnails in Lightbox
  • Loading branch information
manny-kunaico authored Aug 18, 2023
2 parents b7ef5fa + 2c2a521 commit a5632f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kunai-consulting/fork-react-image-lightbox",
"version": "6.0.5",
"version": "6.0.6",
"description": "A lightbox component for React.js",
"scripts": {
"build": "rollup -c",
Expand Down
33 changes: 23 additions & 10 deletions src/react-image-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1633,25 +1633,38 @@ class ReactImageLightbox extends Component {
/>
))}
{this.props.thumbnailImages.map((img, index) => (
<img
className={`thumbNails${
imageIndex === index + 1 ? 'active' : ''
}`}
<button
style={{
margin: '14px',
padding: '2px',
paddingTop: '3px',
paddingRight: '3px',
paddingBottom: '0px',
paddingLeft: '3px',
borderRadius: '4px',
}}
src={img}
key={img}
role="presentation"
alt={img.caption}
type="button"
aria-label="view fullsize image for this thumbnail"
className={`thumbNails${
imageIndex === index + 1 ? 'active' : ''
}`}
onClick={() => {
return !this.isAnimating()
? this.requestMoveIndex({ index })
: undefined;
}}
/>
onKeyPress={() => {
return !this.isAnimating()
? this.requestMoveIndex({ index })
: undefined;
}}
>
<img
src={img}
key={img}
role="presentation"
alt={img.caption}
/>
</button>
))}

{nextSrc &&
Expand Down

0 comments on commit a5632f1

Please sign in to comment.