Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ios] transitionDuration is not interrupted correctly #2667

Open
freeboub opened this issue Feb 4, 2025 · 0 comments
Open

[ios] transitionDuration is not interrupted correctly #2667

freeboub opened this issue Feb 4, 2025 · 0 comments
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@freeboub
Copy link

freeboub commented Feb 4, 2025

Description

When using react-native-screens on ios, the prop transition is not coherently interrupted.
reproduced with fabric & react native 0.77.

  • I push a screen with an animation of 10 sec
  • after 5sec, I umount the screen
  • I am expecting the screen animation (slide up) to be canceled and the screen starts the scroll down animation.
  • But instead:
    • The animation jump to the end directly.
    • The scroll down animation start only at the end of first animation (so here 5 seconds after the slide down request)

Here is a video of the issue:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-02-04.at.16.55.57.mp4

I was not able to clearly / easily reproduce the issue on android due to: #2666

Steps to reproduce

Here is the sample code to reproduce the issue:

 const [childDisplayed, setChildDisplayed] = useState(false);

  // autoclose the view
  useEffect(() => {
    if (childDisplayed) {
      setTimeout(() => {
        setChildDisplayed(false);
      }, 5000);
    }
  }, [childDisplayed]);

  return (
    <SafeAreaView style={{ backgroundColor: 'white', height: '100%' }}>
    <ScreenStack style={StyleSheet.absoluteFill}>
      <Screen
        key="parent"
        activityState={2}
        style={StyleSheet.absoluteFill}>
        <Pressable
            style={styles.pressable}
            onPress={() => {
              setChildDisplayed(true);
            }}/>
      </Screen>
      {childDisplayed ? (
        <Screen
          key="child"
          activityState={2}
          transitionDuration={10000}
          isNativeStack
          stackAnimation={'slide_from_bottom'}
          style={StyleSheet.absoluteFill}>
            <View style={styles.square}/>
        </Screen>) :
        <></> }
    </ScreenStack>
    </SafeAreaView>
  );

Snack or a link to a repository

https://github.com/freeboub/bug-react-native-screens-modal-animation

Screens version

4.6.0

React Native version

0.77.0

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

1 participant