Dashboard dropdown bug

Hi,
Using latest node red 1.1.2 with dashboard 2.23.0
I'm using the multiple selection feature - i.e. inputting to the node a list of options (msg.options).
Sometimes when I select one or more values - the msg.payload shows more options ??
Also if I dont select anything - the msg.payload still shows one selection.

Here is a simple example which shows the bug:
Try injecting different options, select some in ui and watch the output messages.

[{"id":"b5f025e7.bd0d58","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"a8a952e6.7ea95","type":"inject","z":"b5f025e7.bd0d58","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":195.5,"y":148,"wires":[["dbcf3065.9a563"]]},{"id":"dbcf3065.9a563","type":"function","z":"b5f025e7.bd0d58","name":"1,2,3","func":"msg.options=['1','2','3'];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":385.5,"y":148,"wires":[["3c6d32ba.c9c93e"]]},{"id":"3c6d32ba.c9c93e","type":"ui_dropdown","z":"b5f025e7.bd0d58","name":"","label":"","tooltip":"","place":"Select option","group":"c64fd4cd.83f2d8","order":4,"width":0,"height":0,"passthru":false,"multiple":true,"options":[],"payload":"","topic":"update","x":537.5,"y":223,"wires":[["e7e69c60.403f5"]]},{"id":"e7e69c60.403f5","type":"debug","z":"b5f025e7.bd0d58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":705.5,"y":220,"wires":[]},{"id":"7f3dd052.89ffb","type":"inject","z":"b5f025e7.bd0d58","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":177.5,"y":243,"wires":[["e3037796.537d28"]]},{"id":"e3037796.537d28","type":"function","z":"b5f025e7.bd0d58","name":"4","func":"msg.options=['4'];\nreturn msg;","outputs":1,"noerr":0,"x":362,"y":240,"wires":[["3c6d32ba.c9c93e"]]},{"id":"abd6e2c0.37546","type":"inject","z":"b5f025e7.bd0d58","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":163.5,"y":330,"wires":[["b55fe5c6.afd168"]]},{"id":"b55fe5c6.afd168","type":"function","z":"b5f025e7.bd0d58","name":"[]","func":"msg.options=[];\nreturn msg;","outputs":1,"noerr":0,"x":365,"y":326,"wires":[["3c6d32ba.c9c93e"]]},{"id":"c64fd4cd.83f2d8","type":"ui_group","z":"","name":"data1","tab":"e25f6f05.d09e6","order":1,"disp":true,"width":"8","collapse":false},{"id":"e25f6f05.d09e6","type":"ui_tab","z":"","name":"info","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Hi and welcome to the forum! You'll need to edit your message to format the flow file JSON properly. Otherwise it cannot be imported due to broken characters.

See: How to share code or flow json

Thanks!
Edited the code as JSON

Using your flow, can you provide a step by step of how to cause the issue?

Select the first inject: 1,2,3. Select in UI 1 & 3 for example.
Then inject the second option: 4. Select in UI 4
Then inject the empty options.
Inject again the 1,2,3 . In the UI , press the dropdown but dont select any value.
msg.payload still shows an array of size 1 with one of the values

yes - def looks like a bug. When using multiple select it doesn't clear the "old" selected values if new options are sent.
Well spotted. Thanks.

fix now in dashboard master - not yet on npm.

Great!. Will update when available in npm

Hello,
I've updated to the dashboard 2.23.1, which fixed the multiple selection bug (old history), but now I noticed a new bug...
When you have values & labels (such as the simple flow shown below) - it outputs wrongly the labels instead of the values..

[{"id":"456c58b2.68d648","type":"ui_dropdown","z":"3a8437c5.8f2d38","name":"","label":"","tooltip":"","place":"Select option","group":"c64fd4cd.83f2d8","order":5,"width":0,"height":0,"passthru":false,"multiple":true,"options":[{"label":"zero","value":0,"type":"num"},{"label":"one","value":1,"type":"num"}],"payload":"","topic":"","x":240,"y":158,"wires":[["333fa5ae.b00bea"]]},{"id":"333fa5ae.b00bea","type":"debug","z":"3a8437c5.8f2d38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","statusVal":"","statusType":"auto","x":479.5,"y":160,"wires":[]},{"id":"c64fd4cd.83f2d8","type":"ui_group","z":"","name":"data1","tab":"e25f6f05.d09e6","order":1,"disp":true,"width":"8","collapse":false},{"id":"e25f6f05.d09e6","type":"ui_tab","z":"","name":"info","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

aaargh... apologies - 2.23.2 will be there in a moment...

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