-
Notifications
You must be signed in to change notification settings - Fork 36
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 doesn't clear selection with msg.payload = [] #756
Comments
I can confirm that sending an empty array does not clear it, and neither does an empty string. However, if the node is changed to multi-select then an empty array does clear it. |
is this a bug or it is designed to work only with multi-selection? |
There is a bug, there should be a way of clearing single selection dropdowns. Whether, for single selection, it should be an empty string (which seems logical to me) or should still be an empty array I will leave to the developers. Perhaps both options should work in both cases. |
@colinl, |
The docs currently say it should be an empty array. Whether it should also allow an empty string I don't know. |
Pull request created. |
Closed by #775 |
Current Behavior
after selected an option, by sending msg.payload=[] will not clear seletion as documented
Expected Behavior
by send msg.payload =[] to ui-dropdown node will clear selection
Steps To Reproduce
[{"id":"b878241ae48df373","type":"inject","z":"b481f6a7426a1928","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":630,"y":1060,"wires":[["fc2672e929484423"]]},{"id":"fc2672e929484423","type":"function","z":"b481f6a7426a1928","name":"function 21","func":"msg.payload = [];\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":1060,"wires":[["f45a08fdd76cf08f"]]},{"id":"f45a08fdd76cf08f","type":"ui-dropdown","z":"b481f6a7426a1928","group":"e039e314bc87dbdd","name":"test","label":"test","tooltip":"","order":0,"width":"3","height":"1","passthru":true,"multiple":false,"options":[{"label":"a","value":"1","type":"str"},{"label":"b","value":"2","type":"str"},{"label":"c","value":"3","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":990,"y":1060,"wires":[["5ad6a6f2fc2c422e"]]},{"id":"5ad6a6f2fc2c422e","type":"debug","z":"b481f6a7426a1928","name":"debug 208","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1140,"y":1060,"wires":[]},{"id":"e039e314bc87dbdd","type":"ui-group","name":"按键选择","page":"ce60fd917fc93e18","width":"12","height":"1","order":-1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"ce60fd917fc93e18","type":"ui-page","name":"场景管理","ui":"bbbca6a8a7b43502","path":"/page4","icon":"home","layout":"grid","theme":"a320a731ce51b7c0","order":4,"className":"","visible":"true","disabled":"false"},{"id":"bbbca6a8a7b43502","type":"ui-base","name":"管理面板","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"navigationStyle":"fixed"},{"id":"a320a731ce51b7c0","type":"ui-theme","name":"Default Theme","colors":{"surface":"#24292e","primary":"#097479","bgPage":"#111111","groupBg":"#333333","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
Environment
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
The text was updated successfully, but these errors were encountered: