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
- Point cursor to a symbol that has tooltip and URL.
- Wait for tooltip to appear
- Now move slightly the mouse
- 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
- in function
OnMouseMove()
, hlData.url is cleared andHideHyperlinkTip()
is called - 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 inIsMouseInsideHyperlink()
function - 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
- 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.
- 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)