2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

fix: prevent back if editing

- remove duplicate beforeCancel
This commit is contained in:
18alantom 2023-08-18 15:54:45 +05:30
parent 1a93ab04a5
commit f95a93860a
2 changed files with 8 additions and 3 deletions

View File

@ -951,7 +951,6 @@ export class Doc extends Observable<DocValue | Doc[]> {
return;
}
await this.trigger('beforeCancel');
await this.trigger('beforeCancel');
await this.setAndSync('cancelled', true);
await this.trigger('afterCancel');

View File

@ -31,9 +31,15 @@ export function useKeys() {
});
const keydownListener = (e: KeyboardEvent) => {
const notMods = !(e.altKey || e.metaKey || e.ctrlKey);
if (e.target instanceof HTMLInputElement && notMods) {
return;
}
if (
e.target instanceof HTMLInputElement &&
!(e.altKey || e.metaKey || e.ctrlKey)
e.target instanceof HTMLElement &&
e.target.contentEditable === 'true' &&
notMods
) {
return;
}