Skip to content

Commit

Permalink
fix(hippy-vue): fix hippy-vue transform multi-animation not working
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and ilikethese committed Oct 29, 2020
1 parent 231ec5a commit 84bd58b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hippy-react/src/modules/animation-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class AnimationSet implements AnimationSet {
*/
public destroy() {
this.removeEventListener();
this.animationList.forEach(item => item.animationId
this.animationList.forEach(item => Number.isInteger(item.animationId)
&& Bridge.callNative('AnimationModule', 'destroyAnimation', item.animationId));
Bridge.callNative('AnimationModule', 'destroyAnimation', this.animationId);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/hippy-vue-native-components/src/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function registerAnimation(Vue) {
const { transform, ...otherStyles } = style;
let animationIds = Object.keys(otherStyles).map(key => style[key].animationId);
if (Array.isArray(transform) && transform.length > 0) {
const transformIds = Object.keys(transform[0]).map(key => transform[0][key].animationId);
const transformIds = [];
transform.forEach(entity => Object.values(entity)
.forEach(value => Number.isInteger(value.animationId)
&& transformIds.push(value.animationId)));
animationIds = [...animationIds, ...transformIds];
}
return animationIds;
Expand Down
2 changes: 1 addition & 1 deletion packages/hippy-vue/src/runtime/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const {

const CACHE = {};

const measureInWindowByMethod = function (el, method) {
const measureInWindowByMethod = function measureInWindowByMethod(el, method) {
const empty = {
top: -1,
left: -1,
Expand Down

0 comments on commit 84bd58b

Please sign in to comment.