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

Metronic 8 Notifications Menu


We are using Metronic 8. In the left aside, there is a "Notifications" button that shows a menu with alerts, updates, and logs. We added a button to delete any alert. When the button is clicked, the menu hides. How can we make it so the menu does not hide?

We tried adding attributes such as:
data-close-on-select="false"
data-kt-menu-static="true"
data-kt-menu-permanent
data-bs-toggle="false"


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


Hi Brian

Stop event propagation on the delete button click. The attributes you tried (data-kt-menu-static="true", data-kt-menu-close-on-select="false", etc.) only prevent closing on outside clicks, not on clicks inside the menu.

Can you try this?

// For all delete buttons in the notifications menu
document.addEventListener("click", function(e) {
// Adjust the selector to match your delete button class/attribute
if (e.target.closest(".btn-delete-notification") || e.target.closest("[data-delete-notification]")) {
e.stopPropagation(); // Prevent event from bubbling to menu link handler
// Your delete logic here
}
});


Thanks



Thanks. This helped me solve it.



Good to hear it worked. If you need help with other Metronic 8 menu customizations or have additional questions, feel free to ask.



Hi Brian

Which Metronic framework are you using?

Thanks



Hi Brian

Could you please specify which framework? HTML, Metronic Angular, Metronic Laravel, HTML into custom existing Laravel, Angular, etc.

Thanks


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