Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10061 closed bug (duplicate)

Tooltip: doesn't position correctly when scrolled off page

Reported by: flimolde Owned by:
Priority: minor Milestone: none
Component: ui.tooltip Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

First, I did search for an existing bug ticket. All I found was a commit from 2010 that sounds like it addresses the exact problem I'm having, but the code has since been changed: https://github.com/jquery/jquery-ui/commit/18a526ad78a0b154e6ce6dc430a025bec7fa2ee2

I've tested with jQuery UI 1.10.4 and 1.11.0-beta.2, both using jQuery 1.11.0.

The problem occurs with Firefox 24.1.0 (ESR), Chrome 34.0.1847.137 m, and IE 10 on Windows 7 Enterprise. I haven't tested any other browsers or operating systems.

To reproduce:

  1. Add a tooltip to an element on a page.
  2. Add an event handler to a button at the bottom of the page that opens the tooltip.
  3. When the event handler is called, the tooltip should display below the element it is attached to (this is assuming the default position option).
  4. Add a large margin-bottom to the button at the bottom of the page.
  5. Scroll down so that you can see the button but not the element the tooltip is attached to.
  6. When the event handler is called, the tooltip will display above the element it is attached to.

The tooltip should display below the element regardless of scrolling. The same thing occurs with any option other than the default position.

Here's a demo: http://jsfiddle.net/b9CKT/

I poked around in the jQuery UI files for about an hour and couldn't determine a solution. Sorry.

Change History (3)

comment:1 Changed 9 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #8710.

comment:2 Changed 9 years ago by flimolde

I didn't realize this was related to the collision settigns. I can stop this from happening by setting collision to none in the position options, but is this the intended functionality or is it a bug?

comment:3 Changed 9 years ago by tj.vantoll

It's a bug. That's why it was closed as a duplicate of #8710—which is an open issue. If you don't need collision detection for your use case, then setting collision to "none" will avoid the issue.

Note: See TracTickets for help on using tickets.