Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

How to Clear a Data while dropdown is closed



<div className="d-flex flex-stack position-relative rounded">
<div
data-kt-menu-trigger="click"
data-kt-menu-overflow="false"
data-kt-menu-placement="top-end"
onClick={() => {
if (dropDownHandler) {
dropDownHandler(value.template_uuid);
}
}}
className="border p-3 rounded cursor-pointer"
>
<KTSVG
path="/media/icons/duotune/general/gen053.svg"
className="svg-icon-2 svg-icon-dark "
/>
</div>
<div
className={`menu menu-sub menu-sub-dropdown position-absolute menu-column m-2 menu-rounded menu-gray-800 menu-state-bg menu-state-primary fw-bold py-4 fs-6 w-200px`}
data-kt-menu="true"
data-popper-placement="bottom"
>
<div
onClick={() => {}}
className="menu-item menu-link cursor-pointer px-5"
>
Clone
</div>
<div className="separator my-2"> </div>
<div className="menu-item cursor-pointer px-5">Rename</div>
<div className="separator my-2"> </div>
<div className="menu-item cursor-pointer px-5">Delete</div>
</div>
</div>

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 (2)


When clearing data while a dropdown is closed, I ensure that the dropdown state doesn't interfere with the data reset. A reliable arthritis in knee method is to trigger a function that clears the relevant data upon closing the dropdown, without re-triggering any open actions or affecting the user interface.



Hi,

Could you please provide us with more info on what you are trying to achieve?

You can use kt.menu.dropdown.hidden event to trigger your logic when dropdown is closed.

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