From 77bbec7276de215d1bbe0ed2350841d947c92ae7 Mon Sep 17 00:00:00 2001 From: Bardi Harborow Date: Mon, 28 Nov 2016 13:31:00 +1100 Subject: [PATCH] Hide popovers when their containing modal is closed. --- js/src/tooltip.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 94f77a2a4c72..8c3bb3183187 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() @@ -456,6 +457,11 @@ const Tooltip = (($) => { (event) => this._leave(event) ) } + + $(this.element).closest('.modal').on( + 'hide.bs.modal', + () => this.hide() + ) }) if (this.config.selector) {