From f1623b75612db5792eb4eb44b1a76dc1d916c088 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Mon, 20 Aug 2018 22:54:18 +0200 Subject: [PATCH] fix: fix DropdownMenu body handler check to ignore the element itself > `andSelf()` is deprecated and should be replaced with `addBack()` > -- @SassNinja Also, `andSelf` cannot be used that way. This commit replace it with the opposite approach: checking if the target is the child of the element or the element itself using `closest()`. --- js/foundation.dropdownMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation.dropdownMenu.js b/js/foundation.dropdownMenu.js index 338cf5c9f..b2aed651b 100644 --- a/js/foundation.dropdownMenu.js +++ b/js/foundation.dropdownMenu.js @@ -284,7 +284,7 @@ class DropdownMenu extends Plugin { const $body = $(document.body); this._removeBodyHandler(); $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', (e) => { - var isItself = this.$element.andSelf().find(e.target).length; + var isItself = !!$(e.target).closest(this.$element).length; if (isItself) return; this._hide(); -- 2.47.2