Describe the bug
The image editor is mostly unresponsive after cropping an image and then undoing twice.
This only happens if the cropping rectangle is resized at least once before cropping.
To Reproduce
Steps to reproduce the behavior:
Uncaught TypeError: Cannot read property 'set' of undefined exception.Uncaught (in promise) The executing command state is locked. exception.Expected behavior
Desktop (please complete the following information):
@fjwong
I understand this issue. Thank you for your detailed report. I'll handle it.
@lja1018 Running into the same problem that @fjwong described.
When can we expect a fix for this? Would really appreciate it!! Thanks!!
@ayappaP
It will be fixed soon. Maybe next week.
@lja1018 Thank you for looking into the matter. We are also hoping this can be fixed soon. 馃槂
At the moment, we've implemented a somewhat hacky workaround that seems to work for our case.
@ayappaP if you are in need of addressing this quickly, perhaps this could be of help to you:
const editorInstance = ... // Tui Image Editor instance
const graphics = editorInstance._graphics;
const canvas = graphics._canvas;
const { onObjectModified } = graphics._handler;
// Detach default 'object:modified' listener and replace it with our own
canvas.off('object:modified', onObjectModified);
canvas.on('object:modified', (event) => {
const { target } = event;
// Ignore all 'object:modified' events triggered by a cropzone.
if (target.type === 'cropzone') return;
// Use the original event handler otherwise.
onObjectModified(event);
});
Thanks a lot @fjwong !!
I will try this.
@lja1018 Thank you for looking into the matter. We are also hoping this can be fixed soon. 馃槂
At the moment, we've implemented a somewhat hacky workaround that seems to work for our case.
@ayappaP if you are in need of addressing this quickly, perhaps this could be of help to you:const editorInstance = ... // Tui Image Editor instance const graphics = editorInstance._graphics; const canvas = graphics._canvas; const { onObjectModified } = graphics._handler; // Detach default 'object:modified' listener and replace it with our own canvas.off('object:modified', onObjectModified); canvas.on('object:modified', (event) => { const { target } = event; // Ignore all 'object:modified' events triggered by a cropzone. if (target.type === 'cropzone') return; // Use the original event handler otherwise. onObjectModified(event); });
This worked for me. Thanks for your help @fjwong !!
@fjwong @ayappaP
Thanks for the report. Resolved in v3.13.0.
Most helpful comment
@lja1018 Thank you for looking into the matter. We are also hoping this can be fixed soon. 馃槂
At the moment, we've implemented a somewhat hacky workaround that seems to work for our case.
@ayappaP if you are in need of addressing this quickly, perhaps this could be of help to you: