Skip to content

Commit

Permalink
fix: transition should be disabled when duration is 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
temper357 authored and andycall committed Aug 4, 2021
1 parent 5497fbb commit a588021
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions kraken/lib/src/css/style_declaration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,20 @@ class CSSStyleDeclaration {
if ((prevValue == null && CSSLength.isAuto(CSSInitialValues[property])) || CSSLength.isAuto(prevValue) || CSSLength.isAuto(nextValue)) {
return false;
}
return CSSTransformHandlers[property] != null &&
(_transitions.containsKey(property) || _transitions.containsKey(ALL));

if (CSSTransformHandlers[property] != null &&
(_transitions.containsKey(property) || _transitions.containsKey(ALL))) {
bool shouldTransition = false;
// Transtion will be disabled when all transition has transitionDuration as 0.
_transitions.forEach((String transitionKey, List transitionOptions) {
double duration = CSSTime.parseTime(transitionOptions[0]).toDouble();
if (duration != 0) {
shouldTransition = true;
}
});
return shouldTransition;
}
return false;
}

EffectTiming? _getTransitionEffectTiming(String property) {
Expand Down

0 comments on commit a588021

Please sign in to comment.