From 68d33120ab68b010320c32085dfba0064b49abd2 Mon Sep 17 00:00:00 2001 From: egamma Date: Tue, 7 Jul 2026 15:35:19 +0200 Subject: [PATCH] fix #188878: Can't hover on top few pixels of editor --- .../scrollDecoration/scrollDecoration.css | 1 + .../editor/test/node/scrollDecoration.test.ts | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/vs/editor/test/node/scrollDecoration.test.ts diff --git a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css index 4a31db23d0e1e..be861a1e6fa48 100644 --- a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css +++ b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css @@ -8,5 +8,6 @@ top: 0; left: 0; height: 6px; + pointer-events: none; box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset; } diff --git a/src/vs/editor/test/node/scrollDecoration.test.ts b/src/vs/editor/test/node/scrollDecoration.test.ts new file mode 100644 index 0000000000000..f6c3b82b59c9a --- /dev/null +++ b/src/vs/editor/test/node/scrollDecoration.test.ts @@ -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' + ); + }); +});