Skip to content

0.33.0

Choose a tag to compare

@b4rtaz b4rtaz released this 19 Oct 10:06
· 2 commits to main since this release
a696f69

This version introduces a new restriction callback: canUnselectStep. You can now prevent a step from being unselected based on your custom logic. When an unselection is blocked, the onStepUnselectionBlocked event is triggered.

const configuration = {
  steps: {
    canUnselectStep: (step, parentSequence) => {
      return areChangesSaved() === true;
    },
  },
  // ...
};

designer.onStepUnselectionBlocked((targetStepId) => { /* ... */ });

Please note that you should NOT use window.confirm() or other blocking functions inside the canUnselectStep callback, as this callback may be invoked multiple times during drag operations. To handle this correctly, implement your own UI logic to notify the user about any required actions before unselection can proceed. Please check this example.