Make MenuComponent not hide on outside click
Hi there!
I am trying to make a dropdown menu not hide when outside click occurs. I am using React and based on the HTML documentation I have tried:
data-kt-menu-permanent='true'
data-kt-menu-static='true'
Both on the button and the menu div itself. It is not working. Can you let me know how to do this?
Thanks,
Tamas
Replies (2)
Hi Tamas,
Thank you for your message, good catch.
I've added the bug ticket to our development backlog, we will fix it in the next release.
For now, as a temporary solution, you can update line 991 in file src/assets/ts/components/MenuComponent.ts.
From
const menuItems = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]')
to
var menuItems = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]:not([data-kt-menu-static="true"])');
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Thanks Lauris,
That fixed the issue.
Best wishes,
Tamas