I want to cancel the card added by "addTask" when I press the [Tab] key or just when focusOut the TextField ...
screenshoot 11.jpg (132.64 KiB) Viewed 1246 times
I already configure the "simpleTaskEdit" with the following code:
simpleTaskEdit: {
disabled: false,
addNewAtEnd: false,
blurAction: 'cancel', // <=== I set it to 'cancel' to revert the change when TAB or lose the focus
...
}
But with that configuration adds the Task as you can see:
Also when editing is started, task is already added to the store. You can try to remove it in the listener. Problem is that simpleTaskEdit feature doesn't expose any public handles. I've opened a feature request to make it more customizable: https://github.com/bryntum/support/issues/3186
You can try to override editTask method of the feature to setup additional listener:
Override.apply(class {
static get target() { return { class : SimpleTaskEdit } }
editTask(record, element) {
const result = super.editTask(record, element);
this.editor.on({
finishEdit() { record.remove() } // removes all edited records, put your condition here
});
return result;
}
})