Skip to content

Commit

Permalink
Fixes #169854: ignore surprising dom nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Aug 23, 2023
1 parent 2ab4a3f commit 8fe686f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ class ElementPath {
);
}

public static isChildOfOverflowGuard(path: Uint8Array): boolean {
return (
path.length >= 1
&& path[0] === PartFingerprint.OverflowGuard
);
}

public static isChildOfOverflowingContentWidgets(path: Uint8Array): boolean {
return (
path.length >= 1
Expand Down Expand Up @@ -538,6 +545,11 @@ export class MouseTargetFactory {

let result: IMouseTarget | null = null;

if (!ElementPath.isChildOfOverflowGuard(request.targetPath) && !ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) {
// We only render dom nodes inside the overflow guard or in the overflowing content widgets
result = result || request.fulfillUnknown();
}

result = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest);
result = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest);
result = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest);
Expand Down

0 comments on commit 8fe686f

Please sign in to comment.