diff --git a/js/src/tooltip.js b/js/src/tooltip.js index ed10057ed0..3d4e93f2b8 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -273,7 +273,7 @@ const Tooltip = (($) => { const attachment = this._getAttachment(placement) this.addAttachmentClass(attachment) - const container = this.config.container === false ? document.body : $(this.config.container) + const container = this.config.container === false ? document.body : $(document).find(this.config.container) $(tip).data(this.constructor.DATA_KEY, this) diff --git a/js/tests/visual/tooltip.html b/js/tests/visual/tooltip.html index 91713044ab..d81b018cc5 100644 --- a/js/tests/visual/tooltip.html +++ b/js/tests/visual/tooltip.html @@ -27,27 +27,40 @@
- - - - - - -
++ + + + + +
++ + + +
+