Skip to content

Show event of tour does not pass the hash of step and previous #371

@hodossy

Description

@hodossy

I am using Shepherd 2.8.0. The problem is in trigger where the arguments is passed to drop, since arguments is not an Array, therefore always an empty list is returned and passed to the show handler as args.

An easy fix would be to convert to array before passing to drop:

trigger(event) {
    if (!isUndefined(this.bindings) && this.bindings[event]) {
      const args = drop(Array.prototype.slice.call(arguments));

      this.bindings[event].forEach((binding, index) => {
        const { ctx, handler, once } = binding;

        const context = ctx || this;

        handler.apply(context, args);

        if (once) {
          this.bindings[event].splice(index, 1);
        }
      });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions