Skip to main content

Search and Top Navigation

#9364 closed bug (fixed)

Opened June 07, 2013 12:15PM UTC

Closed October 02, 2013 03:02PM UTC

Last modified October 07, 2013 02:30PM UTC

Dialog: Click of element with tooltip scrolls the dialog to the top

Reported by: thojon Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.dialog Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

See this fiddle:

Clicking the link at the bottom in the dialog works the first time (in my case, a div is toggled) but after the first time it doesn't work, the scrollbar moves to top and nothing happens. The scenario only arises when you have tooltip on ths js-link and you have a link at top of the page and that the js link you click is not shown from start, eg you have to scroll down to click it.

It works correctly in jquery ui 1.9.2

Attachments (0)
Change History (8)

Changed June 08, 2013 02:04AM UTC by tj.vantoll comment:1

component: ui.coreui.dialog
status: newopen
summary: Tooltip on js link in dialog messes up js callDialog: Click of element with tooltip scrolls the dialog to the top

I'm still not exactly sure what's going on here but I could recreate the problem. Reduced:

  • The behavior changed per the dialog rewrite in 1.10.
  • The behavior only occurs when a tooltip is placed on the link.

Not only is a click event not occurring on the tooltip, click events seem to be completely suppressed.

$( document ).on( "click", function() {} )
never fires.

Changed July 25, 2013 12:03PM UTC by Anna comment:2

The problem is in the function '_moveToTop'.

For some reason it runs on each click inside a dialog. If it finds any visible elements behind the dialog, it moves them above the dialog and scrolls the dialog to top. But the tooltip is simply added to the body right after the dialog and it is visible when you click on the element with it.

For me, the issues is fixed by preventing the _moveToTop function launching for tooltips. But I think it will not help if some custom tooltips or elements will be added.

Changed September 24, 2013 07:07AM UTC by seppo.savolainen comment:3

I encountered the same problem. Can you dirty fix this by overriding _moveToTop of the Dialog like this:

_moveToTop: function (event, silent) {

var moved = !!this.uiDialog.nextAll(":visible:not(.ui-tooltip)").insertBefore( this.uiDialog ).length;

if ( moved && !silent ) {

this._trigger( "focus", event );


return moved;


I added :not(.ui-tooltip) to the selector, so _moveToTop doens't consider tooltips as other dialogs.

Changed September 30, 2013 11:56AM UTC by jzaefferer comment:4

Just tested this with my fix for #9166 in place (see It works as intended, since the DOM shuffling is gone. Can this be considered a duplicate of #9166? The underlying issue is the same, even if the symptoms are different.

Changed September 30, 2013 12:33PM UTC by scottgonzalez comment:5

I think this is sufficiently different enough to not close a duplicate. But it should be closed by that PR, so let's update the commit message before landing.

Changed October 02, 2013 03:02PM UTC by Jörn Zaefferer comment:6

resolution: → fixed
status: openclosed

Dialog: Switch back to shuffling z-index, but only look at .ui-front siblings.

Fixes #9166 - Dialog: moveToTop implementation resets flash/video/iframe/scroll

Fixes #9364 - Dialog: Click of element with tooltip scrolls the dialog to the top

Changeset: e263ebda99f3d414bae91a4a47e74a37ff93ba9c

Changed October 02, 2013 03:06PM UTC by scottgonzalez comment:7

milestone: none1.11.0

Changed October 07, 2013 02:30PM UTC by tj.vantoll comment:8

#9591 is a duplicate of this ticket.