From fcad20324def0f79324e9530d045ec1b93b4974e Mon Sep 17 00:00:00 2001 From: zealotchen Date: Tue, 26 Mar 2024 11:45:52 +0800 Subject: [PATCH] feat(vue-next): fix hippytext setText --- .../packages/hippy-vue-next/src/runtime/text/hippy-text.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driver/js/packages/hippy-vue-next/src/runtime/text/hippy-text.ts b/driver/js/packages/hippy-vue-next/src/runtime/text/hippy-text.ts index 2c8f6690fc8..9a2f619b6ed 100644 --- a/driver/js/packages/hippy-vue-next/src/runtime/text/hippy-text.ts +++ b/driver/js/packages/hippy-vue-next/src/runtime/text/hippy-text.ts @@ -34,11 +34,14 @@ export class HippyText extends HippyNode { super(NodeType.TextNode, ssrNode); this.text = text; this.data = text; + + // text nodes do not need to be inserted into Native + this.isNeedInsertToNative = false; } public setText(text: string): void { this.text = text; - if (this.parentNode && this.nodeType === NodeType.ElementNode) { + if (this.parentNode && this.parentNode.nodeType === NodeType.ElementNode) { (this.parentNode as HippyElement).setText(text); } }