From f7a4b3976789f1e96bad43ca561ef461f22d6be4 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 2 Nov 2018 10:24:35 +0100 Subject: handle detached tooltip when we try to hide a modal --- js/src/tooltip.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'js/src') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 3d3130bb5..cf8b8e118 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -486,13 +486,17 @@ class Tooltip { (event) => this._leave(event) ) } - - $(this.element).closest('.modal').on( - 'hide.bs.modal', - () => this.hide() - ) }) + $(this.element).closest('.modal').on( + 'hide.bs.modal', + () => { + if (this.element) { + this.hide() + } + } + ) + if (this.config.selector) { this.config = { ...this.config, -- cgit v1.2.3