Skip to content

Commit

Permalink
fix dropdown return types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Oct 26, 2020
1 parent b0bf13e commit 44578af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add node-id property to each md-card.
- Force time picker image to contrast with background.
- Let slider show status even if no nodes attached to output.
- Fix dropdown to return correct message type.

### 2.23.4: Maintenance Release

Expand Down
2 changes: 1 addition & 1 deletion dist/dashboard.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# Time: Sat Oct 24 2020 22:54:02 GMT+0100 (British Summer Time)
# Time: Mon Oct 26 2020 21:17:31 GMT+0000 (Greenwich Mean Time)

CACHE:
i18n.js
Expand Down
5 changes: 2 additions & 3 deletions nodes/ui_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ module.exports = function(RED) {
var val = node.multiple ? [] : "";
for (var i=0; i<control.options.length; i++) {
if (!node.multiple && control.options[i].value === msg) {
if (typeof control.options[i].value === "string") {
if (typeof control.options[i].value === "string" && control.options[i].type !== "str") {
try { control.options[i].value = JSON.parse(control.options[i].value); }
catch(e) {}
}
val = control.options[i].value;
break;
} else if (node.multiple && Array.isArray(msg) && msg.indexOf(control.options[i].value) !== -1) {
if (typeof control.options[i].value === "string") {
if (typeof control.options[i].value === "string" && control.options[i].type !== "str") {
try { control.options[i].value = JSON.parse(control.options[i].value); }
catch(e) {}
}
Expand Down Expand Up @@ -168,7 +168,6 @@ module.exports = function(RED) {
node.status({shape:"dot",fill:"grey",text:node.state[1] + " | " + node.state[1]});
}
}

}
});

Expand Down

0 comments on commit 44578af

Please sign in to comment.