From c07d963bd50910f9df519db05ed7f1a496ff03cc Mon Sep 17 00:00:00 2001 From: alvarosabu Date: Sun, 26 Mar 2023 12:06:09 +0200 Subject: [PATCH] fix: ensure parent for nodeOps target when key is a function --- src/core/nodeOps.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/nodeOps.ts b/src/core/nodeOps.ts index 1f1b71b7e..3fa1f8a46 100644 --- a/src/core/nodeOps.ts +++ b/src/core/nodeOps.ts @@ -119,9 +119,7 @@ export const nodeOps: RendererOptions = { }, patchProp(node, prop, _prevValue, nextValue) { if (node) { - /* if (node.isCamera && prop === 'look-at') { - debugger - } */ + let root = node let key = prop const camelKey = kebabToCamel(key) @@ -152,8 +150,8 @@ export const nodeOps: RendererOptions = { if (value === '') value = true // Set prop, prefer atomic methods if applicable if (isFunction(target)) { - /* if (Array.isArray(value)) target(...value) - else target(value) */ + if (Array.isArray(value)) node[camelKey](...value) + else node[camelKey](value) return } if (!target?.set && !isFunction(target)) root[camelKey] = value