Detect end of shape resize

Hello,

I want to achieve that I call a function when the resize event is terminated. For that I implemented a CustomRules but I don’t know to what event I can add the rule since shape.resize triggers every time during the resize and not only at the end.

this.addRule('shape.resize', 4000, function(context) {
      return resize(context);
    });
async function resize(context) {
      console.log(context);
     // should call a function only when the resize process is terminated
    }

Thanks in advance!

You can listen for resize.canceled:

eventBus.on("resize.canceled", () => {
  console.log("resize was canceled");
});
1 Like

Thanks for the quick and helpful response!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.