Skip to content

Commit

Permalink
fix editor losing focus on save (#287)
Browse files Browse the repository at this point in the history
- fix bug where editor would lose focus on save
- adjust debounce to original timing
  • Loading branch information
cloverich authored Dec 31, 2024
1 parent 7b0eb29 commit 88f62d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/views/edit/EditableDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export class EditableDocument {
if (this.dirty && !wasError) this.save();
}
},
3000,
{ leading: true },
1000,
{ trailing: true },
);

del = async () => {
Expand Down
7 changes: 1 addition & 6 deletions src/views/edit/PlateContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,7 @@ export default observer(
);

return (
<Plate
initialValue={value as any}
onChange={setValue}
plugins={plugins}
readOnly={saving}
>
<Plate initialValue={value as any} onChange={setValue} plugins={plugins}>
{children}
</Plate>
);
Expand Down

0 comments on commit 88f62d3

Please sign in to comment.