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
(cherry picked from commit
8cf98798a58afb7197bce0d6ca1c5b658ae04011)
.addClass( "ui-tooltip-content" )
.appendTo( tooltip );
- 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;