apache / incubator-weex

Apache Weex (Incubating)
https://weex.apache.org
Apache License 2.0
13.75k stars 1.82k forks source link

[Android] Unexpected behavior when using v-for and animation where weex version is 0.28.0 #3165

Open wmlgl opened 4 years ago

wmlgl commented 4 years ago

Describe the bug

在div中使用v-for指令时,如果对该div或div的子节点通过动画模块使用动画效果,会出现异常并无效。

To Reproduce

<template>
  <div>
    <div :ref="'div'+i" v-for="i in [1,2,3]" style="width:30px;height:100px;background-color:blue">
      {{i}}
    </div>
  </div>
</template>

<script>
  export default {
    mounted(){
      var animation = weex.requireModule('animation');
        animation.transition(this.$refs.div1, {
          styles:{
            width: '200px'
          }
        })
    }
  }
</script>

demo link

Environment

Expected behavior

动画正常运行

Additional context

2020-03-12 22:57:40.871 9402-9409/? E/WeexCore: jsc_utils.cc:173, [JSValueToRuntimeValue] error :circular reference on property:parentNode on array index:0 on property:children on property:parentNode on array index:0 on array index:0
2020-03-12 22:57:40.873 9138-9278/com.iche361.kdcbb E/weex: callModuleMethod >>> invoke module:animation, method:transition failed. java.lang.NullPointerException: Attempt to invoke virtual method 'int com.alibaba.fastjson.JSONArray.size()' on a null object reference
        at com.taobao.weex.bridge.NativeInvokeHelper.prepareArguments(NativeInvokeHelper.java:96)
        at com.taobao.weex.bridge.NativeInvokeHelper.invoke(NativeInvokeHelper.java:47)
        at com.taobao.weex.bridge.WXModuleManager.dispatchCallModuleMethod(WXModuleManager.java:247)
        at com.taobao.weex.bridge.WXModuleManager.callModuleMethod(WXModuleManager.java:229)
        at com.taobao.weex.bridge.WXBridgeManager.callModuleMethod(WXBridgeManager.java:507)
        at com.taobao.weex.bridge.WXBridgeManager.callNativeModule(WXBridgeManager.java:676)
        at com.taobao.weex.bridge.WXBridge.callNativeModule(WXBridge.java:369)
        at com.taobao.weex.base.SystemMessageHandler.nativeRunWork(Native Method)
        at com.taobao.weex.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:103)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:173)
        at android.os.HandlerThread.run(HandlerThread.java:65)