Opened 11 years ago

#2390 new defect

Ajax Viewer: fixed pad values in isMouseInsideHyperlink() interferes with Ctrl-click

Reported by: gabrimonfa Owned by:
Priority: medium Milestone:
Component: AJAX Viewer Version: 2.5.0
Severity: major Keywords:
Cc: External ID:

Description

Step to reproduce the bug

  1. Point cursor to a symbol that has tooltip and URL.
  2. Wait for tooltip to appear
  3. Now move slightly the mouse
  4. The tooltip is yet there but Ctrl-click does not go to the URL

(Tested in Firefox 25/26, Chrome 29-31)

Expected

  • While tooltip is shown, ctrl-click should work.

Movement in 3. may be have been done inadvertently, while searching ctrl key in the keyboard and this is very confusing for the users

Looking at the code

  1. in function OnMouseMove(), hlData.url is cleared and HideHyperlinkTip() is called
  2. function HideHyperlinkTip() hides the tooltip, except when the mouse is inside the tooltip (probably to let the user interact with tooltip content, f.i. to click on a link). The check is done in IsMouseInsideHyperlink() function
  3. function IsMouseInsideHyperlink() considers a fixed amount of pixels to the left and to the top of tooltip element, probably to account for cursor icon.

Those padding values are fixed to 20 and 30 pixels respectively in x and y axis.

Thus cursor appears to be inside tooltip, while it is not and the bug shows up.

Possible solutions

  1. In my setup users does not need to interact with tooltip content, so there is no need to prevent tooltip hiding when cursor is inside it.

Thus I simply commented out the check in function HideHyperlinkTip(). IMHO is also better not to show a tooltip that invite to Ctrl-click to have more info, when in fact it does not works if the mouse has been moved from its original position. Tooltip hiding also let the viewer call again RequestHyperLinkData() with the new position, presenting the user a new tooltip and a new URL, that are correct w.r.t. to current cursor position.

  1. If users need to interact with the tooltip it would be better to remove excessive padding (and obviously also to remove the text that invite to Ctrl-click, since users open the url by clicking the link)

Change History (0)

Note: See TracTickets for help on using tickets.