GutterTooltip: CSS class ace_gutter-tooltip
is not set properly when opening the tooltip
#5209
Labels
ace_gutter-tooltip
is not set properly when opening the tooltip
#5209
Describe the bug
When showing a
GutterTooltip
, we set theace_gutter-tooltip
CSS class on it: https://github.com/ajaxorg/ace/blob/master/src/mouse/default_gutter_handler.js#L206A 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-L211In 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 newGutterTooltip.showTooltip
. If you continue hovering over the gutter icon without closing the tooltip,GutterTooltip.showTooltip
will re-applyace_gutter-tooltip
and not callGutterTooltip.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
beforeGutterTooltip.setClassName
: https://github.com/ajaxorg/ace/blob/master/src/mouse/default_gutter_handler.js#L206-L211Ace Version / Browser / OS / Keyboard layout
v1.22.1 / Firefox / MacOS / Qwerty
The text was updated successfully, but these errors were encountered: