> `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()`.
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();