Skip to content

Commit

Permalink
fix: update isClosing in stack card (#9738)
Browse files Browse the repository at this point in the history
I noticed that accessing `closing` through `cardStyleInterpolator` would always return an Animated node with value 0. It looks like it isn't being updated anywhere, so I added it to the `animate` method.

I am using this functionality to allow screens to have different in and out transitions.

On a side note, I feel like this would be more useful as a boolean, instead of an Animated value.

Co-authored-by: Michael Ru <michaelru@abridge.com>
  • Loading branch information
2 people authored and satya164 committed Nov 27, 2022
1 parent d82d44b commit 31b5955
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ export default class Card extends React.Component<Props> {

this.lastToValue = toValue;

this.isClosing.setValue(closing ? TRUE : FALSE);

const spec = closing ? transitionSpec.close : transitionSpec.open;

const animation =
Expand Down

0 comments on commit 31b5955

Please sign in to comment.