Skip to content

Commit

Permalink
fix: Entire content selection on first resource selection
Browse files Browse the repository at this point in the history
  • Loading branch information
erdkse committed Aug 31, 2021
1 parent 68fe1e1 commit 9e9df50
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 88 deletions.
172 changes: 86 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/molecules/Monaco/Monaco.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ const Monaco = (props: {editorHeight: string}) => {
}, [selectedResourceId, resourceMap]);

useEffect(() => {
if (editor) {
if (editor && code) {
editor.revealLineNearTop(1);
editor.setSelection(new monaco.Selection(0, 0, 0, 0));
}
}, [editor, selectedResourceId]);
}, [editor, code]);

return (
<>
Expand Down

0 comments on commit 9e9df50

Please sign in to comment.