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

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
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 (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
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  :(