microsoft / microsoft/monaco-editor

[Bug] Cannot click Find Widget buttons due to tooltip flickering

Open
#5,208 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link

No response

Monaco Editor Playground Code

Reproduction Steps

No response

Actual (Problematic) Behavior

No response

Expected Behavior

No response

Additional Context

Summary

When using Monaco Editor's Find Widget (Ctrl+F / Cmd+F), the Close button (X) and adjacent buttons (e.g., "Find in Selection") become unclickable due to a rapid tooltip flickering effect.

Environment

  • Monaco Editor version: @monaco-editor/react v4.7.0 (monaco-editor core)
  • Browser: Chrome (latest stable)
  • OS: macOS

Expected Behavior

When hovering over the Close button (X) or other buttons in the Find Widget, I should be able to click them normally.

Actual Behavior

When hovering over these buttons:

  1. A tooltip (.workbench-hover-container) appears
  2. The tooltip immediately triggers a mouseout event on the button
  3. This causes the tooltip to disappear
  4. With the tooltip gone, the mouse is back "on" the button, triggering another tooltip
  5. This creates an infinite loop of rapid show/hide cycles (flickering)
  6. During this flickering, click events cannot be registered on the button

Note: The Escape key still works to close the Find Widget - only mouse interaction is broken.

Steps to Reproduce

  1. Open any Monaco Editor instance
  2. Press Ctrl+F (or Cmd+F on Mac) to open the Find Widget
  3. Move mouse cursor to hover over the Close button (X) on the right side of the widget
  4. Observe the tooltip flickering rapidly
  5. Try to click the button
  6. Result: The button click does not register

Root Cause Analysis

Using Chrome DevTools with a MutationObserver, we captured the tooltip element being created:

const observer = new MutationObserver((mutations) => {
  mutations.forEach(m => {
    m.addedNodes.forEach(node => {
      if (node.nodeType === 1) console.log('Added:', node.className, node);
    });
  });
});
observer.observe(document.body, { childList: true, subtree: true });

Console output when hovering over the Close button:

Added: workbench-hover-container <div class="workbench-hover-container">...</div>
Added: workbench-hover-container <div class="workbench-hover-container">...</div>
Added: workbench-hover-container <div class="workbench-hover-container">...</div>
Added: workbench-hover-container <div class="workbench-hover-container">...</div>
... (repeats rapidly)

The .workbench-hover-container element is being created and destroyed in a rapid loop, indicating the flickering behavior.

Workaround

Hiding the hover container with CSS resolves the issue:

.workbench-hover-container {
  display: none !important;
}

This completely disables the hover tooltip, which stops the flickering loop and allows normal button clicks.

Alternative (if you want to keep tooltips visible but non-blocking):

.workbench-hover-container {
  pointer-events: none !important;
}

Note: This alternative did NOT work in our testing - the flickering loop continued even with pointer-events: none.

Impact

  • Users cannot use mouse to close the Find Widget
  • Users cannot click "Find in Selection" and other toolbar buttons
  • Workaround exists (Escape key), but mouse interaction is a fundamental UX expectation

Suggested Fix

The hover tooltip positioning or timing logic may need adjustment to prevent the tooltip from triggering a mouseout event on the button it's describing. Possible approaches:

  1. Add a small delay before showing the tooltip
  2. Ensure the tooltip doesn't overlap or interfere with the button's hover area
  3. Use pointer-events: none on the tooltip container (though this didn't work as a CSS override, it might work if implemented in the source)

Related Issues

  • Similar to Issue #5139 which reported tooltip flickering on Find Widget buttons (closed without resolution)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in a Monaco Editor instance with the Find Widget open, then inspect the tooltip behavior around the .workbench-hover-container element and the Find Widget buttons. Done means the Close, Find in Selection, and other toolbar buttons accept mouse clicks without tooltip flickering while tooltips retain their intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.