Skip to content

Commit

Permalink
[#69800] contain editor overscroll
Browse files Browse the repository at this point in the history
This helps when both the editor and page are scrollable and the page can
be accidentally scrolled when the editor is scrolled to the bottom.
  • Loading branch information
Trzcin committed Dec 4, 2024
1 parent 57542bd commit e1a3972
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/CodeMirror.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const CodeEditor = styled.div`
height: 100%;
scrollbar-width: thin;
overflow-y: auto;
overscroll-behavior: contain;
color: black;
position: relative;
box-shadow: inset 0px 0px 4px rgba(0, 0, 0, 0.15);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Diff.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const DiffContainer = styled.div`
height: 100%;
scrollbar-width: thin;
overflow-y: auto;
overscroll-behavior: contain;
`;

const MergeViewCodeEditor = styled(CodeEditor)`
overflow-y: visible;
overscroll-behavior: contain;
display: block;
`;

Expand Down
1 change: 1 addition & 0 deletions src/components/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Preview = styled.div`
word-wrap: break-word;
position: relative;
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-width: thin;
@media print {
Expand Down
1 change: 1 addition & 0 deletions src/components/Resolved.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ResolvedWrapper = styled.div`
border-radius: var(--border-radius);
color: var(--gray-900);
overflow-y: auto;
overscroll-behavior: contain;
& h1 {
font-size: 20px;
Expand Down

0 comments on commit e1a3972

Please sign in to comment.