From 15df5cf168697d243c9a1ff8150b05a607d20cea Mon Sep 17 00:00:00 2001 From: Reece Date: Mon, 20 Oct 2025 18:05:55 +0100 Subject: [PATCH] - --- .../src/components/onboarding/OnboardingTour.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/onboarding/OnboardingTour.tsx b/frontend/src/components/onboarding/OnboardingTour.tsx index f765d85fd..1d90ee36f 100644 --- a/frontend/src/components/onboarding/OnboardingTour.tsx +++ b/frontend/src/components/onboarding/OnboardingTour.tsx @@ -2,11 +2,7 @@ import React from "react"; import { TourProvider, useTour, - type StepType, - type ClickProps, - type KeyboardHandlerArgs, - type StylesObj, - type ComponentsObj + type StepType } from '@reactour/tour'; import { useOnboarding } from '../../contexts/OnboardingContext'; import { useTranslation } from 'react-i18next'; @@ -258,16 +254,16 @@ export default function OnboardingTour() { e.stopPropagation(); advanceTour(clickProps); }} - keyboardHandler={({ event: e, setCurrentStep, currentStep, setIsOpen }) => { + keyboardHandler={(e, clickProps) => { // Handle right arrow key to advance tour - if (e.key === 'ArrowRight') { + if (e.key === 'ArrowRight' && clickProps) { e.preventDefault(); - advanceTour({ setCurrentStep, currentStep, setIsOpen, steps }); + advanceTour(clickProps); } // Handle escape key to close tour - else if (e.key === 'Escape') { + else if (e.key === 'Escape' && clickProps) { e.preventDefault(); - handleCloseTour({ setCurrentStep, currentStep, setIsOpen, steps }); + handleCloseTour(clickProps); } }} styles={{