Skip to content

Commit 20f68a8

Browse files
committed
Move list check to scrollToBottom
1 parent 75e1561 commit 20f68a8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/app/src/app/components/Preview/DevTools/Console/elements.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const Messages = styled.div`
2020
2121
> div {
2222
overflow-y: auto;
23+
overflow-x: hidden;
2324
}
2425
`;
2526

packages/app/src/app/components/Preview/DevTools/Console/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ class Console extends React.Component {
171171
};
172172

173173
componentDidUpdate() {
174-
if (this.list) {
175-
this.scrollToBottom();
176-
}
174+
this.scrollToBottom();
177175
}
178176

179177
scrollToBottom = () => {
180-
this.list.scrollTop = this.list.scrollHeight;
178+
if (this.list) {
179+
this.list.scrollTop = this.list.scrollHeight;
180+
}
181181
};
182182

183183
evaluateConsole = (command: string) => {

0 commit comments

Comments
 (0)