Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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 ?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

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.
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(