The Taskboard trigger sync at the moment I clicked the button addTask with the "SimpleTaskEdit" feature activated like so:
Screen Shot 2021-07-07 at 9.28.41 a.m..png (156.89 KiB) Viewed 1682 times
How can I suspend this behavior? I want to trigger the sync request but until the user accept the change in the inline text editing by pressing the [Enter] key ...
Hello.
Simplest solution I can think of is to disable autoSync for this period of time. I don't see any suitable events, so you will have to extend some classes. Smth like:
class MyTaskBoard extends TaskBoard {
async addTask() {
const me = this;
this.project.autoSync = false;
this.project.taskStore.on({
update() { // this event will fire when you change name in simple editor
me.project.autoSync = true;
me.project.sync();
}
once : true // this will unbind listener after first call
});
return super.addTask(...arguments);
}
}
Hi @Maxim, I found an issue with this change, if I dont made any change in the textbox of the card and lose the focus of the textbox in the card, the sync operation never trigger the request of the new card like so:
This is expected for the case when you do not modify original value. Unfortunately, taskboard doesn't expose editor or any events for this case. So there's no public way to monitor finish editing. I opened a feature request: https://github.com/bryntum/support/issues/3156
In the meantime you can get editor handle and listen to finishEdit event on it: