eclipse-theia/theia

[Feature] Pass event to CommandHandler

Open

#4,738 opened on Mar 27, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (18,676 stars) (2,478 forks)batch import
enhancementhelp wantedtoolbar

Description

Description

I was looking into the new sidepanel toolbar and I wanted to register a toolbar item for one of my sidenav widgets that, on click, opens a context menu with more actions. This requires the click event's payload in order to extract the target which serves as an anchor point for the context menu. Before we had the sidepanel toolbar I created my own toolbar widget and was able to access the event object.

My workaround for now is to query the element using document.getElementById

const el = document.getElementById(MyCommands.SETTINGS.id);

and use that to call contextMenuRenderer.render.

OS and Theia version: OSX Mojave 10.14, Theia 0.5.0-next.21d54a76

Contributor guide