Skip to content

Commit

Permalink
Merge pull request #116 from DDMAL/saved-status-fix
Browse files Browse the repository at this point in the history
fix: a cell without change doesn't alter save status
  • Loading branch information
kunfang98927 authored Jul 12, 2024
2 parents 07282c4 + 177785b commit ec3761c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Editor/CressTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ export class CressTable {
private initChangeListener() {
changeHooks.forEach((hook) => {
this.table.addHook(hook, (source) => {
if (source != 'loadData') setSavedStatus(false);
if (source != 'loadData') {
if (hook === 'afterChange') {
const oldValue = source[0][2];
const newValue = source[0][3];
if (oldValue !== newValue) setSavedStatus(false);
} else {
setSavedStatus(false);
}
}
});
});
}
Expand Down

0 comments on commit ec3761c

Please sign in to comment.