How can I disable the "kt-menu" dismiss function when click outside the DOM
<div class="d-flex justify-content-end" data-kt-table-toolbar="base">
<button id="filter" type="button" class="btn btn-light-primary me-3" data-kt-menu-trigger="click"data-kt-menu-placement="bottom-end">Filter</button>
<div class="menu menu-sub menu-sub-dropdown w-250px w-md-500px w-sm-375px" data-kt-menu="true">
<div class="px-7 py-5">
<div class="fs-5 text-dark fw-bolder">Filter Options</div>
</div>
</div>
</div>
I want to keep the popup menu open when clicking outside the DOM, is there any solution to make this done ?
Replies (1)
Hi,
This requires a minor change in the KTMenu component's source code src/js/components/menu.js
by adding the new attribute in the KTMenu.initHandlers()
static method and recompile it with gulp or webpack:
var items = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]:not([data-kt-menu-static="true"])');
In the menu toggle element just add:
<a href="#" data-kt-menu-trigger="click" data-kt-menu-static="true"
We will include this change in the next update.
Regards.
Your Support Matters!
We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.