UI Dropdown - weird phenomena when using numbers as options, can you explain?

hello,

I found a weird behaviour with the ui_dropdown when using it with numbers as options.
Basically when the options are dynamically defined in the flow, each value can only be selected once( weird, right ?). Example: say you have a dropdown with 4 options: 1, 2, 3, 4 . If you select 1, the dropdown payload will be set to 1 as expected. The same happens if afterwards one selects 2. However, if after one attempts to select 1 again the payload will be always empty for whatever option you've selected before. The workaround I found was to send the options again to the dropdown but I think we should not have to.

When using a dropdown with options statically defined, everything works normally. Therefore, you can freely jump between options and have the payload always updated accordingly.

I'm using v2.23.4 of node-red-dashboard.
Find below a flow to quickly see the described behaviour:

thanks for your help, cheers

[{"id":"b1341bfd.e517d8","type":"tab","label":"Debug flow","disabled":false,"info":""},{"id":"deca38e1.e7e458","type":"inject","z":"b1341bfd.e517d8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["82913aaf.7dd868"]]},{"id":"82913aaf.7dd868","type":"function","z":"b1341bfd.e517d8","name":"generateOptionsNumbers","func":"var newMsg = {};\n\nnewMsg.options=[1,2,3,4];\nreturn newMsg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":140,"wires":[["1cc7342f.ae536c"]]},{"id":"1cc7342f.ae536c","type":"ui_dropdown","z":"b1341bfd.e517d8","name":"","label":"dropdown dynamic","tooltip":"","place":"Select option","group":"b07c8076.b2f8c","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":710,"y":140,"wires":[["7a3f3f73.1eed8"]]},{"id":"424a30.9a6fc5d","type":"ui_dropdown","z":"b1341bfd.e517d8","name":"","label":"dropdown static","tooltip":"","place":"Select option","group":"b07c8076.b2f8c","order":1,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"","value":1,"type":"num"},{"label":"","value":2,"type":"num"},{"label":"","value":3,"type":"num"},{"label":"","value":4,"type":"num"}],"payload":"","topic":"","x":700,"y":60,"wires":[["7a3f3f73.1eed8"]]},{"id":"7a3f3f73.1eed8","type":"debug","z":"b1341bfd.e517d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":60,"wires":[]},{"id":"b07c8076.b2f8c","type":"ui_group","z":"","name":"Test","tab":"5ec0d4bf.b1de9c","order":1,"disp":true,"width":"6","collapse":false},{"id":"5ec0d4bf.b1de9c","type":"ui_tab","z":"","name":"LAB","icon":"dashboard"}]

Welcome to the forum @diogom8.

I am not seeing that. I suggest upgrading to the latest dashboard (2.26.1).

1 Like

hello @Colin , thanks for the quick reply.

indeed, upgrading to the latest dashboard solved the issue. thanks for your help!

cheers

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.