Even though there's no reason to ever configure the parent element via an
`appendTo` option, following the standard logic is useful for scrollable
elements and native dialogs.
Fixes #10739
Closes gh-1517
this._addClass( content, "ui-tooltip-content" );
this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
- tooltip.appendTo( this.document[ 0 ].body );
+ tooltip.appendTo( this._appendTo( element ) );
return this.tooltips[ id ] = {
element: element,
delete this.tooltips[ tooltip.attr( "id" ) ];
},
+ _appendTo: function( target ) {
+ var element = target.closest( ".ui-front, dialog" );
+
+ if ( !element.length ) {
+ element = this.document[ 0 ].body;
+ }
+
+ return element;
+ },
+
_destroy: function() {
var that = this;