Skip to content

Commit

Permalink
Fix iOS app freezing on animate-tray.jsx snippet
Browse files Browse the repository at this point in the history
Since atm issue cannot be fixed in the native platform this change
introduces a workaround which prevents it.

see #1988

Change-Id: Iac0013333a15ca0584ffa5bcd721cf913cddf396
  • Loading branch information
karolszafranski committed Mar 18, 2020
1 parent a0ec14b commit c2a3446
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions snippets/animate-tray.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ async function positionTrayInRestingState(velocity) {
trayState = 'animating';
const translationY = velocity > 0 ? trayHeight : 0;
const options = {duration: Math.min(Math.abs(trayHeight / velocity * 1000), 800)};
await Promise.all([
shade.animate({opacity: getShadeOpacity(translationY)}, options),
strapIcon.animate({transform: getStrapIconTransform(translationY)}, options),
tray.animate({transform: {translationY}}, options)
]);
if (tray.transform.translationY !== translationY) { // workaround eclipsesource/tabris-js#1988
await Promise.all([
shade.animate({opacity: getShadeOpacity(translationY)}, options),
strapIcon.animate({transform: getStrapIconTransform(translationY)}, options),
tray.animate({transform: {translationY}}, options)
]);
}
trayState = velocity > 0 ? 'down' : 'up';
}

Expand Down

0 comments on commit c2a3446

Please sign in to comment.