Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI dropdown - Unable to set a preselected option #675

Closed
3 tasks
giuseppeg88 opened this issue Jan 31, 2021 · 7 comments
Closed
3 tasks

UI dropdown - Unable to set a preselected option #675

giuseppeg88 opened this issue Jan 31, 2021 · 7 comments

Comments

@giuseppeg88
Copy link

What are the steps to reproduce?

Send a msg (with a string in msg.payload) to a dropdown node.

What do you expect to happen & what happens?

Until the release 1.2.5, the dropdown node was correctly updated with the text contained in the received payload.
With the new release (1.2.7) this does not happen.

Please tell us about your environment:

  • Node-RED version: 1.2.7
  • Platform/OS: Windows 10
  • Browser: Chrome 88.0.4324.104
@dceejay
Copy link
Member

dceejay commented Feb 1, 2021

Sorry - I don't think I understand the problem correctly - A simple test like this works for me

[{"id":"6ef8490f.9cb1b8","type":"inject","z":"78444ab3.45a654","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":120,"y":900,"wires":[["ed6105a4.0d3598"]]},{"id":"ed6105a4.0d3598","type":"ui_dropdown","z":"78444ab3.45a654","name":"","label":"","tooltip":"","place":"Select option","group":"a223b12f.6e05a","order":1,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"A","value":"a","type":"str"},{"label":"B","value":"b","type":"str"},{"label":"C","value":"c","type":"str"}],"payload":"","topic":"","x":290,"y":900,"wires":[["3aabe573.2b246a"]]},{"id":"3aabe573.2b246a","type":"debug","z":"78444ab3.45a654","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":470,"y":900,"wires":[]},{"id":"a223b12f.6e05a","type":"ui_group","name":"Default","tab":"45c56a9a.0646c4","order":1,"disp":true,"width":"6","collapse":false},{"id":"45c56a9a.0646c4","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Can you share a simple example that shows your actual issue ?
Thanks

@giuseppeg88
Copy link
Author

giuseppeg88 commented Feb 1, 2021

Hi, I've just tried your flow: it stops working if you turn off the option "If msg arrives on input, pass through to output".

[{"id":"68e6f8c8.ddd598","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"ed6105a4.0d3598","type":"ui_dropdown","z":"68e6f8c8.ddd598","name":"","label":"","tooltip":"","place":"Select option","group":"a223b12f.6e05a","order":1,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"A","value":"a","type":"str"},{"label":"B","value":"b","type":"str"},{"label":"C","value":"c","type":"str"}],"payload":"","topic":"","x":400,"y":240,"wires":[["3aabe573.2b246a"]]},{"id":"3aabe573.2b246a","type":"debug","z":"68e6f8c8.ddd598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":240,"wires":[]},{"id":"6ef8490f.9cb1b8","type":"inject","z":"68e6f8c8.ddd598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":230,"y":240,"wires":[["ed6105a4.0d3598"]]},{"id":"a223b12f.6e05a","type":"ui_group","name":"Default","tab":"45c56a9a.0646c4","order":1,"disp":true,"width":"6","collapse":false},{"id":"45c56a9a.0646c4","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Thanks

@dceejay
Copy link
Member

dceejay commented Feb 1, 2021

indeed - if the message doesn't pass through then it won't set the selected option.

@giuseppeg88
Copy link
Author

giuseppeg88 commented Feb 1, 2021

But the intent is not to send over the message but only to update the UI.
The use case is, for example, when you want to align the selected element to a state setted by an external factor.

Until the previous release it worked in this way and, in fact, the documentation doesn't say that the "pass through" must be enabled in order to update the UI.

@dceejay
Copy link
Member

dceejay commented Feb 1, 2021

true - looking at it now.
(update: Have found the offending line... not sure why it got added... must have been for a reason... so now need to check past test cases)

@dceejay dceejay transferred this issue from node-red/node-red Feb 1, 2021
@dceejay dceejay closed this as completed in bb853d3 Feb 8, 2021
@number005
Copy link

As this is closed I guess its solved from 2.28.0 on? Right?

@knolleary
Copy link
Member

@number005 yes. The commit that closed this issue was included in 2.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants