Skip to content

user-onboarding: tour Next/Previous/custom buttons do nothing on click #87

Description

@piyushsinghgaur1

Describe the bug

In @sourceloop/user-onboarding-client, clicking Next, Previous or a custom button (e.g. Skip) in a tour step does nothing. The tour stays on the current step.

Cause

shepherd.js expects a button's action to be the click handler itself ((this: Tour) => void) and calls it on click. TourButton.action is typed as () => Step.StepOptionsButton['action'], a function that returns a handler.

Under the stricter TypeScript 6 checks that came with the Angular 22 upgrade, the assignments in TourServiceService.actionAssignment were wrapped (b.action = () => handler) to match that type. So on click, shepherd.js gets the handler back but never runs it.

To Reproduce

  1. Run a tour with more than one step using the latest library version.
  2. Click Next (or Previous / a custom button) on a step.
  3. Nothing happens.

Expected behavior

The button runs its handler: it moves to the next or previous step (navigating routes where needed) or runs the custom registered function.

Proposed fix

  • Type TourButton.action as Step.StepOptionsButton['action'].
  • Assign the handlers directly in actionAssignment again, as before the upgrade.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions