Skip to content

disableKeyboardNavigation Not Behaving Consistently with disableDotsNavigation #682

@nitschn

Description

@nitschn

Description:

There is an issue with how the disableKeyboardNavigation and disableDotsNavigation props behave in Reactour. While disableDotsNavigation is correctly activated in the current step, disableKeyboardNavigation is only activated in the next step, allowing users to still navigate through the tour with keyboard input.

Expected Behavior:

Both disableKeyboardNavigation and disableDotsNavigation should behave consistently, being activated in the current step to prevent users from navigating forward or backward while the tour is locked.

Actual Behavior:

  • disableDotsNavigation is activated immediately in the current step, which prevents navigation through dots.
  • disableKeyboardNavigation, however, is not activated until the next step, meaning users can still use keyboard navigation.

Steps to Reproduce:

const [lockTour, setLockTour] = useState(false);

<TourProvider
  steps={steps(setLockTour)}
  disableKeyboardNavigation={lockTour}
  disableDotsNavigation={lockTour}
/>;

export function steps(setLockTour) {
  return [
    {
      action: (elem) => {
        setLockTour(true);
        elem.onclick = () => {
          setLockTour(false);
        };
      },
    },
  ];
}

Suggested Fix:

Ensure that disableKeyboardNavigation is activated in the current step, similar to how disableDotsNavigation behaves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions