V2.23.4 Dropdown sending numbers instead of strings

After upgrading node-red to 1.2.2 and the dashboard to 2.23.4 I have found some issues with the Dropdown node.

  1. Following the upgrade all existing dropdowns now have Allow Multple Selections enabled, which was not the case before.

  2. With the node configured like this:

image

I find that instead of sending strings like "15.0" it is sending the number 15. If I set the value to an alpha string such as abc then it does send a string, but with anything that can be converted to a number it sends that instead of a string. Clearing the labels does not make any difference.

Here is a little flow to test it. Select option "abc" and it sends the string "abc", select option 1.0 and it sends number 1 instead of string "1.0". I think that has to be a bug doesn't it?

[{"id":"65a8817f.1c618","type":"ui_dropdown","z":"bdd7be38.d3b55","name":"","label":"","tooltip":"","place":"Select option","group":"a8e4a3.d31edb6","order":3,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"","value":"1.0","type":"str"},{"label":"","value":"abc","type":"str"}],"payload":"","topic":"","x":210,"y":4760,"wires":[["8f66b34d.841898"]]},{"id":"8f66b34d.841898","type":"debug","z":"bdd7be38.d3b55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":420,"y":4780,"wires":[]},{"id":"a8e4a3.d31edb6","type":"ui_group","name":"Chart","tab":"8032fe72.980b98","order":3,"disp":false,"width":"6","collapse":false},{"id":"8032fe72.980b98","type":"ui_tab","name":"PnH","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

I have reverted to 2.19.4 and confirmed that it works correctly there, I have also confirmed that if a dropdown is added in 2.19.4 and the dashboard updated that Allow Multiple becomes checked, which I think is another bug as it changes the way the node works.

Hi Colin - thanks for spotting that - fixed pushed to master on npm.

Excellent, thanks.

The second issue seems to be there still, unless I am misinterpreting what is happening. If I revert to 2.19.4 and add a dropdown, then upgrade to master the dropdown has Allow Multiple Selections selected.

ah yes - now also fixed... While checking can you also cross check that other issue also ? Thanks

Yes, all working now, along with the other issue (Default Value for Dropdown). I have added a note there.

Thanks for the verification

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