Skip to content

Commit

Permalink
Merge pull request #971 from bartbutenaers/radiobutton-false-null-fix
Browse files Browse the repository at this point in the history
radiobutton false vs null fix
  • Loading branch information
joepavitt authored Jun 14, 2024
2 parents c24f353 + b71e876 commit 60c52ef
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ui/src/widgets/ui-radio-group/UIRadioGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default {
widgetId: this.id,
msg
})
// When a msg comes in from Node-RED, we need support 2 operations:
// 1. add/replace the radio options (to support dynamic options e.g: radiobuttons populated from a database)
// 2. update the selected value(s)
Expand All @@ -103,13 +104,8 @@ export default {
onChange () {
// ensure our data binding with vuex store is updated
const msg = this.messages[this.id] || {}
if (this.value) {
// return a single value
msg.payload = this.value
} else {
// return null
msg.payload = null
}
// return a single value
msg.payload = this.value
this.$store.commit('data/bind', {
widgetId: this.id,
msg
Expand Down

0 comments on commit 60c52ef

Please sign in to comment.