Material DatePicker and dropdown menus
Using material datepicker, inside dropdown menus,
When a date is selected dropdown closes, how to avoid it?
THanks
Replies (2)
At first, you should add attribute (data-kt-menu-self-trigger) into your trigger element
<button type="button" class="btn btn-secondary btn-sm show menu-dropdown" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-self-trigger="true">Show</button> Then find this function
KTMenu.initHandlers = function() { in components/menu.js and place the code below after if (menuObj && menuObj.getItemSubType(item) === "dropdown") { if (!item.contains(e.target) && menuObj.getTriggerElement().getAttribute("data-kt-menu-self-trigger") ) {
continue;
} Now your dropdown will be closing after clicking trigger element only
Hi,
Sorry for the late response.
Try to check the attribute: data-kt-menu-trigger, the value has to be hover, cause with click it will close himself then.
Regards,
Keenthemes support
Your Support Matters!
We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.