vue3-context-menu
vue3-context-menu copied to clipboard
How to append the menu's div inside the App's div?
How can I generate the menu's div inside the App's div?
Details
Right now the menu's div is created outside the App's div and I can not reach to it (for some test units).
Trying to get around this issue elegantly so I also asked for ideas here: https://stackoverflow.com/questions/78296814/how-to-reference-html-elements-from-ouside-the-app-in-vue
Menu is mount to body
by default, you can change it use getContainer
property in MenuOptions, Change container.
ContextMenu.showContextMenu({
getContainer: () => document.querySelector('#app'),
//...
})
Thanks. That helped. I need that to simulate a right click using vue test utils. I sense I'm a little bit closer but still need a way to figure why the wrapper.click('click.right') does not trigger the menu to appear to be added to the DOM (while it works in a real browser)