Fix uncaught TypeError in Tour module by validating focus() and currentStep usage in Shepherd callbacks

Created on 9 July 2025, 11 days ago

Problem/Motivation

An uncaught JavaScript `TypeError` is thrown in the Tour module when `currentStep` is `undefined` during Shepherd's `show()` or `cancel` callbacks. The error prevents the tour from properly ending and disrupts the user experience.

Steps to reproduce

  • Start a tour.
  • Navigate through steps.
  • When a tour ends or is canceled, it does not exit cleanly and throws a JS error.

Proposed resolution

  • Add safety checks before accessing `currentStep.el.querySelector(...)` to ensure `currentStep` and `el` exist and `.focus()` is callable.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024