Skip to content

Commit

Permalink
fix: the arrow buttons also must respect ltr or rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Dec 19, 2024
1 parent e7ceb68 commit d42f7dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/view/useSlideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const useSlideshow = (displayItems, slideshowElementRef) => {
const handleKeyDown = (event) => {
if (document.fullscreenElement) {
if (event.key === 'ArrowRight') {
nextItem()
document.dir === 'ltr' ? nextItem() : prevItem()
} else if (event.key === 'ArrowLeft') {
prevItem()
document.dir === 'ltr' ? prevItem() : nextItem()
}
}
}
Expand Down

0 comments on commit d42f7dd

Please sign in to comment.