#4428 Tooltip for comment "Reply" button changes based on hover position
Closed: Fixed 4 months ago by pingou. Opened 5 months ago by ferdnyc.

The Reply button on issue/PR comments has this tooltip:

Reply to this comment - lose formatting

But the span containing its icon has its tooltip set to:

Reply to this comment

The result being, the " - lose formatting" string will appear and disappear from the tooltip text depending where you position your mouse pointer over the button.

Condensed HTML source for the Reply button, with non-related structures removed for clarity:

<div class="btn-group" role="group" aria-label="Basic example">
    <a class="reply btn btn-outline-primary border-0" data-toggle="tooltip"
 title="Reply to this comment - lose formatting" href="javascript:void(0)">
        <span class="fa fa-share-square-o" title="Reply to this comment"></span>
    </a>
</div>

(BTW, this isn't true of the Reply button below the initial issue text, which doesn't have a separate tooltip set on its icon. Only the Reply button in the upper-right corner of previous comments — the small, textless one — shows the behavior described.)

This no longer seems to be true. The nested pair of tags is now showing up as:

<a class="reply btn btn-outline-primary border-0" data-toggle="tooltip" 
title="" href="javascript:void(0)" data-original-title="Reply to this comment - lose formatting">
  <span class="fa fa-share-square-o" title="Reply to this comment"></span>
</a>

And the data-original-title doesn't set the tooltip. Not sure if something changed, or my browser was just being weird, but closing.

Metadata Update from @ferdnyc:
- Issue close_status updated to: Insufficient data
- Issue status updated to: Closed (was: Open)

5 months ago

Aargh! I take it back. It looks like it still is true, but only when there's no "Add Reaction" button to the left of the Reply button?

See the attached composite screenshot of my own two previous comments, one showing the outer tooltip, the other not.

Screenshot_from_2019-04-20_08-47-27.png

Metadata Update from @ferdnyc:
- Issue status updated to: Open (was: Closed)

5 months ago

You've done quite a bit of investigation on this issue already, would you like to work on the fix as well?

Metadata Update from @pingou:
- Issue tagged with: JS, UI, bug, easyfix

5 months ago

@pingou

You've done quite a bit of investigation on this issue already, would you like to work on the fix as well?

I'll be honest, I really don't know what the correct behavior is, here. The apparent non-determinism of it confuses me completely. "Fix" implies the reversal of a deviation from a known-good state, an obvious correct behavior that should be restored. That doesn't describe the situation here for me at all. It's hard to fix something when you have no idea how it's supposed to work in the first place.

  • Why is the "Add reaction" button sometimes missing from comments? (I've still noticed that, off and on. But what I haven't detected is a pattern.)
  • Why would that affect the Reply button?
  • What's data-original-title anyway, and why would the Reply button be left in a state where its attributes include data-toggle="tooltip" title="" data-original-title="Reply to this comment - lose formatting"? (...An empty title?)

Finally, and not least, what actually is the correct tooltip? Making the tooltip match between the icon and the surrounding button area would seem like the most sensible fix, but what title should they both have? Is it supposed to include the "- lose formatting" note, or not?

(N.b: I guess the answer to my last bullet point may be that it's a bug in whatever "bootstrap" is? But this bug report is 5 years old, and it's about a version that hasn't been maintained since 2016.)

@pingou I submitted #4443 that simply removes the title= attribute from the inner icon span tag completely. I don't know if that will have the intended effect of just letting its surrounding a tag's title define the tooltip for the entire control, but it seems to be how the other button tag-based controls are set up.

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 months ago

Metadata Update from @pingou:
- Issue set to the milestone: 5.6

4 months ago

Login to comment on this ticket.

Metadata
Attachments 1