Skip to content

Commit 5480144

Browse files
author
Ives van Hoorne
committed
Fix scrolling in console
Fixes codesandbox#968
1 parent 0ed9d0b commit 5480144

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export const Container = styled.div`
1212
display: flex;
1313
flex-direction: column;
1414
max-height: calc(100% - 2rem);
15-
LOG_BORDER: 'inherit',
16-
LOG_BORDER: 'inherit',
17-
border-color: ${props => props.theme['statusBar.border'] || '#191C1D'}
15+
border-color: ${props => props.theme['statusBar.border'] || '#191C1D'};
1816
`;
1917

2018
export const Messages = styled.div`

packages/app/src/app/pages/Sandbox/Editor/Content/prevent-gesture-scroll.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
function preventScroll(event) {
22
// We don't want to scroll below zero or above the width and height
33
const maxX = this.scrollWidth - this.offsetWidth;
4-
const maxY = this.scrollHeight - this.offsetHeight;
54

65
// If this event looks like it will scroll beyond the bounds of the element, prevent it and set the scroll to the boundary manually
76
if (
87
this.scrollLeft + event.deltaX < 0 ||
9-
this.scrollLeft + event.deltaX > maxX ||
10-
this.scrollTop + event.deltaY < 0 ||
11-
this.scrollTop + event.deltaY > maxY
8+
this.scrollLeft + event.deltaX > maxX
129
) {
1310
event.preventDefault();
1411

@@ -17,7 +14,6 @@ function preventScroll(event) {
1714
0,
1815
Math.min(maxX, this.scrollLeft + event.deltaX)
1916
);
20-
this.scrollTop = Math.max(0, Math.min(maxY, this.scrollTop + event.deltaY));
2117
}
2218
}
2319

0 commit comments

Comments
 (0)