Skip to content

Commit

Permalink
chore: reset scroll on loads
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Sep 27, 2024
1 parent 76ae461 commit 3107d61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hooks/useEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export const useEditor = create<EditorStore>((set, get) => ({
path: "main.js",
});

get().editor?.setScrollTop(0);
get().update();
get().run();
},
Expand All @@ -247,6 +248,8 @@ export const useEditor = create<EditorStore>((set, get) => ({
});

useProject.persist.rehydrate();

get().editor?.setScrollTop(0);
get().update();
get().run();
},
Expand Down

0 comments on commit 3107d61

Please sign in to comment.