Skip to content

Fix Edge native password reveal icon overlap#3434

Open
Darshan2923 wants to merge 2 commits into
SonarSource:masterfrom
Darshan2923:fix-edge-password-reveal-icon
Open

Fix Edge native password reveal icon overlap#3434
Darshan2923 wants to merge 2 commits into
SonarSource:masterfrom
Darshan2923:fix-edge-password-reveal-icon

Conversation

@Darshan2923
Copy link
Copy Markdown

@Darshan2923 Darshan2923 commented May 19, 2026

Description

Microsoft Edge displays its native password reveal icon alongside SonarQube's custom password visibility toggle on the login page while typing in the password field.

The native icon disappears after focus changes, but duplicate controls are visible during initial interaction.

Root Cause

Edge injects a native reveal control for password inputs.

Fix

Hide Edge native reveal and clear pseudo-elements using a small inline style injected into the shared HTML shell.

Testing

The CSS rule was manually validated in Microsoft Edge using browser DevTools, confirming that hiding the native ::-ms-reveal and ::-ms-clear pseudo-elements removes the duplicate password reveal icon while preserving SonarQube's custom visibility toggle.

Before Image:
image

After Image:
image

@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha Bot commented May 19, 2026

Summary

This PR fixes a visual issue in Microsoft Edge where the browser's native password reveal icon (::-ms-reveal and ::-ms-clear pseudo-elements) overlaps with SonarQube's custom password visibility toggle on the login page.

The fix adds a small inline style that hides Edge's native controls using CSS-only targeting (display: none). The style is injected into the HTML template's <head> via a string replacement in WebPagesCache, making it available to all pages without requiring any code changes outside this utility class.

What reviewers should know

What changed: One Java file (WebPagesCache.java) — adds a CSS constant and a single .replace() call to inject it into the HTML template.

Start here: The entire change is in WebPagesCache.java lines 48–110. The logic is straightforward:

  • New constant EDGE_PASSWORD_REVEAL_STYLE (lines 48–56) contains the CSS rule
  • Single new line (108) injects the style before </head> during template processing
  • Indentation reformatting is included for consistency

Why it works: The fix targets only Edge-specific pseudo-elements using the -ms- vendor prefix, which other browsers safely ignore. This avoids adding browser-detection logic.

Scope: The change applies globally to all HTML pages served through this cache, which is appropriate since the password reveal overlap is a global UI concern on the login page.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is the right approach for this browser-specific issue, and the CSS selectors are correct for both modern Chromium-based Edge and Edge Legacy. However, the implementation has a test coverage gap that means the new behavior is never actually exercised by the test suite.

🗣️ Give feedback

…ixture to include </head> and asserting the injected ::-ms-reveal and ::-ms-clear styles are present.
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 23, 2026

Code Review ✅ Approved

Hides Microsoft Edge's native password reveal and clear pseudo-elements by injecting CSS into the HTML shell, preventing icon overlap. Includes updated test coverage to verify the style injection.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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