Proposed investigation: right-click links in canvases #41
Replies: 1 comment
-
If there is a way to do this elegantly, I have not found it! However, by adding a new canvas A (rudimentary, proof-of-concept) solution to expose a dynamically generated anchor element when the user right-clicks on a block, from which the user can display a context menu by (again) right-clicking on it, has been coded up and added to Demo canvas-009: Clicking on the canvas outside of a block will display the expected image-related context menu: I don't see the need to do any further work on this idea. Closing the discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently we can create an entity with an anchor attribute which, with a little additional boilerplate to pass events down to the entity, will allow navigation via mouse/touch click and keyboard tab/enter strokes. Existing code respects browser-specific additional keys (shift, ctrl, alt, etc) during the click so the navigation will occur with results that user would expect when using that browser (eg: open in new tab, window, etc)
However current functionality does not support right-click mouse events which generate a contextmenu event. At the moment the right click will trigger on the canvas element (by default) and display the image-related context menu, whereas what we would like the UI to display is the link-related context menu. Additionally, the system stores no information that a contextmenu event is underway so even if the user selects an item from the menu the resulting mouseup/etc event will trigger and be captured/passed-down in the normal way (if coded for).
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event
vs
A separate edge case is a drag event on a navigation entity with associated anchor - expected usage would be for the link url to be copied (where?) so that it can be applied/pasted when the drag event ends eg: dragging a link to the browser address bar to open the link in a new tab. This use case feels a lot more complex so is out of scope for this work.
Beta Was this translation helpful? Give feedback.
All reactions