From 535fec93cf8892d1a83f6bb8cb97adc589af2b39 Mon Sep 17 00:00:00 2001 From: Bardi Harborow Date: Wed, 30 Nov 2016 04:45:14 +1100 Subject: [PATCH] Hide popovers when their containing modal is closed. (#21227) --- js/src/tooltip.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index dbc9cf18c3..2b659b8854 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -224,6 +224,7 @@ const Tooltip = (($) => { $.removeData(this.element, this.constructor.DATA_KEY) $(this.element).off(this.constructor.EVENT_KEY) + $(this.element).closest('.modal').off('hide.bs.modal') if (this.tip) { $(this.tip).remove() @@ -454,6 +455,11 @@ const Tooltip = (($) => { (event) => this._leave(event) ) } + + $(this.element).closest('.modal').on( + 'hide.bs.modal', + () => this.hide() + ) }) if (this.config.selector) { -- 2.47.3