Skip to content

Commit 2819e44

Browse files
committed
update scrollbars when dimensions change
1 parent 450daa7 commit 2819e44

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.css

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,70 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
.monaco-diff-editor .diff-review-line-number {
7-
text-align: right;
8-
display: inline-block;
9-
color: var(--vscode-editorLineNumber-foreground);
6+
.monaco-component.diff-review {
7+
user-select: none;
8+
-webkit-user-select: none;
9+
z-index: 99;
1010
}
1111

1212
.monaco-diff-editor .diff-review {
1313
position: absolute;
14-
user-select: none;
15-
-webkit-user-select: none;
16-
z-index: 99;
14+
15+
}
16+
17+
.monaco-component.diff-review .diff-review-line-number {
18+
text-align: right;
19+
display: inline-block;
20+
color: var(--vscode-editorLineNumber-foreground);
1721
}
1822

19-
.monaco-diff-editor .diff-review-summary {
23+
.monaco-component.diff-review .diff-review-summary {
2024
padding-left: 10px;
2125
}
2226

23-
.monaco-diff-editor .diff-review-shadow {
27+
.monaco-component.diff-review .diff-review-shadow {
2428
position: absolute;
2529
box-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;
2630
}
2731

28-
.monaco-diff-editor .diff-review-row {
32+
.monaco-component.diff-review .diff-review-row {
2933
white-space: pre;
3034
}
3135

32-
.monaco-diff-editor .diff-review-table {
36+
.monaco-component.diff-review .diff-review-table {
3337
display: table;
3438
min-width: 100%;
3539
}
3640

37-
.monaco-diff-editor .diff-review-row {
41+
.monaco-component.diff-review .diff-review-row {
3842
display: table-row;
3943
width: 100%;
4044
}
4145

42-
.monaco-diff-editor .diff-review-spacer {
46+
.monaco-component.diff-review .diff-review-spacer {
4347
display: inline-block;
4448
width: 10px;
4549
vertical-align: middle;
4650
}
4751

48-
.monaco-diff-editor .diff-review-spacer > .codicon {
52+
.monaco-component.diff-review .diff-review-spacer > .codicon {
4953
font-size: 9px !important;
5054
}
5155

52-
.monaco-diff-editor .diff-review-actions {
56+
.monaco-component.diff-review .diff-review-actions {
5357
display: inline-block;
5458
position: absolute;
5559
right: 10px;
5660
top: 2px;
5761
z-index: 100;
5862
}
5963

60-
.monaco-diff-editor .diff-review-actions .action-label {
64+
.monaco-component.diff-review .diff-review-actions .action-label {
6165
width: 16px;
6266
height: 16px;
6367
margin: 2px 0;
6468
}
6569

66-
.monaco-diff-editor .revertButton {
70+
.monaco-component.diff-review .revertButton {
6771
cursor: pointer;
6872
}

src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ class View extends Disposable {
354354
super();
355355

356356
this.domNode = this._element;
357-
this.domNode.className = 'diff-review monaco-editor-background';
357+
this.domNode.className = 'monaco-component diff-review monaco-editor-background';
358358

359359
const actionBarContainer = document.createElement('div');
360360
actionBarContainer.className = 'diff-review-actions';
@@ -381,6 +381,12 @@ class View extends Disposable {
381381
this._scrollbar = this._register(new DomScrollableElement(this._content, {}));
382382
reset(this.domNode, this._scrollbar.getDomNode(), actionBarContainer);
383383

384+
this._register(autorun(r => {
385+
this._height.read(r);
386+
this._width.read(r);
387+
this._scrollbar.scanDomNode();
388+
}));
389+
384390
this._register(toDisposable(() => { reset(this.domNode); }));
385391

386392
this._register(applyStyle(this.domNode, { width: this._width, height: this._height }));

0 commit comments

Comments
 (0)