Skip to content

Commit

Permalink
ui-text number 0 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bartbutenaers committed Nov 23, 2024
1 parent 75c7e62 commit 071bad0
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 071bad0

Please sign in to comment.