Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
top: 0;
left: 0;
height: 6px;
pointer-events: none;
box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;
}
24 changes: 24 additions & 0 deletions src/vs/editor/test/node/scrollDecoration.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import assert from 'assert';
import { readFileSync } from 'fs';
import { join } from '../../../base/common/path.js';
import { FileAccess } from '../../../base/common/network.js';
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../base/test/common/utils.js';

suite('ScrollDecoration', () => {
ensureNoDisposablesAreLeakedInTestSuite();

test('scroll-decoration CSS should have pointer-events: none to not block hover on top editor pixels', () => {
const cssDir = FileAccess.asFileUri('vs/editor/browser/viewParts/scrollDecoration').fsPath;
const cssPath = join(cssDir, 'scrollDecoration.css');
const cssContent = readFileSync(cssPath, 'utf8');
assert.ok(
cssContent.includes('pointer-events: none'),
'scroll-decoration.css must include "pointer-events: none" so the decorative shadow element does not block pointer events on the top pixels of the editor'
);
});
});