# \[ANNOUNCE\] node-red-contrib-ui-contextmenu - typedinputs

**URL:** https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973
**Category:** Share Your Nodes
**Created:** [13 July 2020 05:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973 "2020-07-13T05:48:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [13 July 2020 05:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/1 "2020-07-13T05:48:04Z")

</div>

Hi folks,

In another [discussion](https://discourse.nodered.org/t/contextmenu-location/22780/71) we had an agreement to send a `msg.event` property on some of the UI nodes. So I also implemented that change in version 2.0.0 of the SVG node, which is _not_ on NPM yet (which will be released this week)!

However the ContextMenu node searched its coordinates in the `msg.position` (hardcoded), instead of in ``msg.event`. To avoid that everybody needs to add Change nodes all over the place (to move the message fields), version _ **2.0.0** _ of the ContextMenu node has following changes:

- It is possible to specify the X and Y coordinate values separately, as fixed coordinate value or as a specified input message field:

- The menu can now also be delivered in any specified input message field:

- The readme file contains more examples and flows. I have also added the demo from @Paul-Reed to the readme, because it demonstrates nicely how the node can be used without the SVG node. Thanks Paul!

- The example flows are now available via the flow editor _"Import"_ menu:

- The input messages are now validated on the server side, which allows me to show some validation errors in the debug panel.

Would be nice if somebody could install this new version from Github, and test it:

```auto
npm install bartbutenaers/node-red-contrib-ui-contextmenu

```

I have added migration logic, so 'normally' the old hardcoded message fields should be automatically filled in into the typedinputs.

As soon as this node is on NPM, I will publish the SVG node.

Thanks!!!  
Bart

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [13 July 2020 09:04 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/2 "2020-07-13T09:04:18Z")

</div>

> [@BartButenaers](#):
>
> Would be nice if somebody could install this new version from Github, and test it:

Still works fine here, using contextmenu for a menu system (not using SVG).

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [13 July 2020 13:50 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/3 "2020-07-13T13:50:26Z")

</div>

Works for me also. (as a new install)

I tried the context\_menu\_for\_button example and - please remember that I am new to all this and lacking in understanding bunches of stuff - the help says that the output `msg.sourceMsg` will contain the original input message but the output I get is the x & y position from the input position object and `_ui_cm_already_seen: true` which is definitely not what I see as the source msg.

Would it be possible to explain how this should be used. (The basic outputs are obvious even to me 😃)

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [13 July 2020 19:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/4 "2020-07-13T19:59:02Z")

</div>

> [@Paul-Reed](#):
>
> Still works fine

Thanks for the confirmation Paul!

> [@Buckskin](#):
>
> Would it be possible to explain how this should be used

Hi Jef (@Buckskin),  
Thanks for testing!!! It is lately difficult to find testers, so all help is welcome ...  
Seems you found a _ **bug** _, which had sneaked into this version.  
It is now fixed on Github:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f718cf6ad7a54b58cc1517bccd69a837653336c9.png)

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [13 July 2020 22:41 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/5 "2020-07-13T22:41:57Z")

</div>

Thank you, yep that fixed it. The only other issue I have (and it may not be related) when I installed the node I got this from the log. Any idea on what node-gyp is and why there should be all these warnings. The contextmenu node is working fine. If it makes any difference the instance of Node-Red I am using for this is running on Ubuntu 16.04 in a VMWare box on Windows 10

```auto
> pi@HomeAutomation:~/.node-red$ npm install bartbutenaers/node-red-contrib-ui-contextmenu
> 
> mdns@2.5.1 install /home/pi/.node-red/node_modules/mdns
> node-gyp rebuild
> 
> make: Entering directory '/home/pi/.node-red/node_modules/mdns/build'
> CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
> In file included from ../src/dns_sd.cpp:1:0:
> ../src/mdns.hpp:32:20: fatal error: dns_sd.h: No such file or directory
> compilation terminated.
> dns_sd_bindings.target.mk:168: recipe for target 'Release/obj.target/dns_sd_bindings/src/dns_sd.o' failed
> make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
> make: Leaving directory '/home/pi/.node-red/node_modules/mdns/build'
> gyp ERR! build error
> gyp ERR! stack Error: `make` failed with exit code: 2
> gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
> gyp ERR! stack at ChildProcess.emit (events.js:198:13)
> gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
> gyp ERR! System Linux 4.4.0-185-generic
> gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
> gyp ERR! cwd /home/pi/.node-red/node_modules/mdns
> gyp ERR! node -v v10.21.0
> gyp ERR! node-gyp -v v5.1.0
> gyp ERR! not ok
> npm WARN node-red-contrib-ui-led@0.3.1 requires a peer of node-red-dashboard@2.14.x but none is installed. You must install peer dependencies yourself.
> npm WARN node-red-project@0.0.1 No repository field.
> npm WARN node-red-project@0.0.1 No license field.
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mdns@2.5.1 (node_modules/mdns):
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mdns@2.5.1 install: `node-gyp rebuild`
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
> 
> + node-red-contrib-ui-contextmenu@2.0.0
> updated 1 package and audited 1043 packages in 36.708s
> 
> 18 packages are looking for funding
> run `npm fund` for details
> 
> found 2 low severity vulnerabilities
> run `npm audit fix` to fix them, or `npm audit` for details

```

> Post edited by Moderator to format printout correctly. See [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [14 July 2020 05:03 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/6 "2020-07-14T05:03:25Z")

</div>

> [@Buckskin](#):
>
> mdns@2.5.1 install /home/pi/.node-red/node\_modules/mdns  
> node-gyp rebuild

That I don't know.

The contextmenu node has _ **no dependencies** _, as you can see in my [package.json](https://github.com/bartbutenaers/node-red-contrib-ui-contextmenu/blob/master/package.json#L5) file.

That mdns package is about multicasting. I see [here](https://www.npmjs.com/package/mdns?activeTab=dependents) that e.g. node-red-contrib-googlehome uses it.

But if you want to solve that, please open another discussion. Otherwise my original question (to get testers) will vanish soon ...

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [25 July 2020 19:51 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/7 "2020-07-25T19:51:41Z")

</div>

As of now it is available on NPM:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5e181e9142dbf38f8c3c2b1ed2edf92a90bf016e.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 September 2020 05:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-contextmenu-typedinputs/29973/8 "2020-09-11T05:48:11Z")

</div>

This topic was automatically closed after 60 days. New replies are no longer allowed.
