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

GutterTooltip: CSS class ace_gutter-tooltip is not set properly when opening the tooltip #5209

Closed
andredcoliveira opened this issue Jun 19, 2023 · 1 comment · Fixed by #5211

Comments

@andredcoliveira
Copy link
Contributor

andredcoliveira commented Jun 19, 2023

Describe the bug

When showing a GutterTooltip, we set the ace_gutter-tooltip CSS class on it: https://github.com/ajaxorg/ace/blob/master/src/mouse/default_gutter_handler.js#L206

A few lines below, we end up resetting the CSS class via GutterTooltip.setTheme if the tooltip was not previously opened: https://github.com/ajaxorg/ace/blob/master/src/mouse/default_gutter_handler.js#L209-L211

In practice, this means that the CSS class is only correctly set if you continue slightly moving the mouse over the gutter icon after the tooltip has already been open.

The issue is particularly noticeable if you use automation (e.g., during tests) to hover over the gutter icon.

Expected Behavior

The ace_gutter-tooltip CSS class is applied consistenly to the tooltip when it's being shown, regardless of its previous state.

Current Behavior

The ace_gutter-tooltip CSS class is removed after the first time the tooltip opens and you need to continue moving the mouse over the tooltip to trigger a new GutterTooltip.showTooltip. If you continue hovering over the gutter icon without closing the tooltip, GutterTooltip.showTooltip will re-apply ace_gutter-tooltip and not call GutterTooltip.setTheme.

Reproduction Steps

Trigger a single hover event over the gutter tooltip icon. I.e.: use automation or place the mouse cursor over the gutter icon without continuing to move the cursor after the hover is triggered—you need to be fast and precise.

Possible Solution

Call GutterTooltip.setTheme before GutterTooltip.setClassName: https://github.com/ajaxorg/ace/blob/master/src/mouse/default_gutter_handler.js#L206-L211

Ace Version / Browser / OS / Keyboard layout

v1.22.1 / Firefox / MacOS / Qwerty

@InspiredGuy
Copy link
Contributor

The fix will be included in the next release.

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

Successfully merging a pull request may close this issue.

3 participants