From d42f7dd0c9b9e33fa58863c4fcfa4c7c028db8e6 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 19 Dec 2024 11:51:06 +0100 Subject: [PATCH] fix: the arrow buttons also must respect ltr or rtl --- src/pages/view/useSlideshow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/view/useSlideshow.js b/src/pages/view/useSlideshow.js index 0a3d5d95f..0d42fc27e 100644 --- a/src/pages/view/useSlideshow.js +++ b/src/pages/view/useSlideshow.js @@ -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() } } }