From 071bad0692479603fe4f43dcb455d44437485c45 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Sat, 23 Nov 2024 20:31:04 +0000 Subject: [PATCH] ui-text number 0 fix --- ui/src/widgets/ui-text/UIText.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/src/widgets/ui-text/UIText.vue b/ui/src/widgets/ui-text/UIText.vue index f88d14a2..987b660a 100644 --- a/ui/src/widgets/ui-text/UIText.vue +++ b/ui/src/widgets/ui-text/UIText.vue @@ -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) {