Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue #237947: Tooltip for Close Button in Dialog Box is Obscure… #237960

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

g122622
Copy link
Contributor

@g122622 g122622 commented Jan 15, 2025

This PR fixes Issue #237947: Tooltip for Close Button in Dialog Box is Obscured by the Dialog Itself

Overview

In dialog.css, the z-index of the dialog modal box is set to 2600:

/** Dialog: Modal Block */
.monaco-dialog-modal-block {
	position: fixed;
	height: 100%;
	width: 100%;
	left:0;
	top:0;
	z-index: 2600;
	display: flex;
	justify-content: center;
	align-items: center;
}

The tooltip is implemented by the contextView, and its z-index is dynamically assigned by JavaScript rather than being statically defined in CSS:

//src\vs\base\browser\ui\contextview\contextview.ts
this.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`;

For tooltips (i.e., hover), its layer is specified by HoverContextViewDelegate as 1, so this JavaScript code above calculates its z-index as 2576, which is lower than the z-index of the dialog mentioned earlier, causing it to be obscured.

Changes

Modified the HoverContextViewDelegate class in src\vs\base\browser\ui\contextview\contextview.ts to change its layer to 26.

Testing

I have used my own TypeScript project to test out this feature.

Before this fix:
Snipaste_2025-01-14_22-04-30

After this fix:
Snipaste_2025-01-14_22-10-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants