My custom context menu on canvas works well, but I'm facing an issue with Text elements. When I try to right-click on a text element, it triggers text selection as if double-clicking.
I attempted to use the following code:
document.addEventListener('contextmenu', (e) => {
e.preventDefault();
})
However, this didn't resolve the problem because the text selection still occurs.