Skip to content

Commit

Permalink
Merge pull request #1500 from bartbutenaers/text-integer-0-fix
Browse files Browse the repository at this point in the history
Ui-text value 0 not displayed
  • Loading branch information
joepavitt authored Nov 29, 2024
2 parents f07d253 + 071bad0 commit 59efe06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/src/widgets/ui-text/UIText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ export default {
// make sure our v-model is updated to reflect the value from Node-RED
if (Object.prototype.hasOwnProperty.call(msg, 'payload')) {
// Sanitize the HTML to avoid XSS attacks
this.textValue = DOMPurify.sanitize(msg.payload)
if (typeof msg.payload === 'string') {
this.textValue = DOMPurify.sanitize(msg.payload)
} else {
this.textValue = msg.payload
}
}
},
onLoad (msg) {
Expand Down

0 comments on commit 59efe06

Please sign in to comment.