Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xAPI event is triggered before the state has been updated when placing elements. #11

Open
OliverColeman opened this issue Jan 14, 2017 · 1 comment

Comments

@OliverColeman
Copy link

When an element is dragged into a drop zone an xAPI 'interacted' event is triggered before the state has been updated, which means the new/current state is not provided by a call to getXAPIData() in handlers listening for xAPI events. This behaviour also seems to be at odds with the way other content types work.

Moving the line this.trigger('addedToZone'); from the start of Draggable.prototype.addToZone to the end fixes this, ie:

  Draggable.prototype.addToZone = function (droppable) {
    if (this.insideDropzone !== null) {
      this.insideDropzone.removeDraggable();
    }
    this.toggleDroppedFeedback(true);
    this.insideDropzone = droppable;
    this.setShortFormat();
    this.trigger('addedToZone');
  };
@tajakobsen
Copy link
Contributor

@OliverColeman We'll look into this. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants