Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

How to Trigger Dropdown Manually ?


<div className="card-toolbar">
<button
onClick={() => {
if (setDropDownId) {
setDropDownId(value.template_uuid);
}
}}
type="button"
className="btn btn-sm btn-icon btn-color-primary btn-active-light-primary"
data-kt-menu-trigger="click"
data-kt-menu-placement="bottom-end"
data-kt-menu-flip="top-end"
>
<KTSVG
path="/media/icons/duotune/general/gen053.svg"
className="svg-icon-2 svg-icon-dark "
/>
</button>
<CustomDropDown
onClone={onClone}
onDelete={onDelete}
onRenameModalOpen={onRenameModalOpen}
/>
</div>


Is that any option to trigger the dropdown manually

data-kt-menu-trigger="click"
data-kt-menu-placement="bottom-end"
data-kt-menu-flip="top-end"

the issue which i am facing currently that sometimes dropdown is not working when clicked if there is option to trigger manually it might the better solution to fix that.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

You can toggle your menu instance programmatically using the following approach:

var item = document.querySelector("#kt_menu_item");
menu.toggle(item);


Regards,
Lauris Stepanovs,
Keenthemes Support Team



Is that Toggle Method is Provided in Metronic React ?? when page refreshed its not working again i have. to visit some other page and back to the component it works



Hi,

Did you modify anything in our core components?

Make sure that you still have the following code in src/layouts/default-layout/DefaultLayout.vue.

watch(
() => route.path,
() => {
nextTick(() => {
reinitializeComponents();
});
}
);


Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(