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

onPositionChange callback gives 'initial' when called with open() method #209

Closed
ydv0121 opened this issue May 18, 2020 · 4 comments
Closed
Labels
🤕 Valid issue Something isn't working

Comments

@ydv0121
Copy link

ydv0121 commented May 18, 2020

Describe the bug
Hello
as i see adjustToContentHeight is working properly with alwaysOpen. (as i reported earlier this one and its fixed in rc25..thank you so much for that..
but after that one more issue i faced that when i am using open(dest) method on button press at that time onPositionChange called and modal will open but onPositionChange callback give me intital when the modal is opened..it should give me top even i am open it with open(dest) method..as i get top in previous version (before rc25).
it will give me proper output when i am using gesture handler to open close

Reproduce
Screen Recording 2020-05-18 at 3 24 01 PM

Dependencies:

  • react-native-modalize :^1.3.7-rc.25
  • react-native : 0.62.2
  • react-native-gesture-handler:1.6.1
@ydv0121 ydv0121 changed the title onPositionChange callback gives 'initial' called with open() method onPositionChange callback gives 'initial' when called with open() method May 18, 2020
@jeremybarbet
Copy link
Owner

Thanks for reporting.

It should be fixed in latest version 2.0.4.

@jeremybarbet jeremybarbet added the 🤕 Valid issue Something isn't working label May 20, 2020
@ydv0121
Copy link
Author

ydv0121 commented May 25, 2020

@jeremybarbet thank you its worked

@AleksandrKarashev
Copy link

AleksandrKarashev commented Aug 3, 2022

version 2.0.13 ,onPositionChange showing 'intial' instead of 'top' with this code after opening -> expanding -> closing -> opening again -> expanding again:

      <Modalize
        ref={modalizeRef}
        onPositionChange={pos => console.log(pos)}
         modalHeight={height - 100}
        snapPoint={MAX_HEIGHT}
        modalStyle={{
          borderTopLeftRadius: 0,
          borderTopRightRadius: 0,
          zIndex: 1,
          backgroundColor:
            theme.mode === 'dark' ? theme.colors.blackPalette[4] : '#fff',
        }}
        onClose={() => {
          resetState()
        }}
        withHandle={true}
        rootStyle={{
          zIndex: 4,
        }}
        scrollViewProps={{
          contentContainerStyle: { height: '100%' },
        }}>

@AleksandrKarashev
Copy link

AleksandrKarashev commented Aug 3, 2022

edit 1: wait...I think snapPoint is making troubles for me.

edit 2: yes, unfortunately onPositionChange doesn't work properly with snapPoint.
edit 3: it does't work properly with snapPoint when we expanding modal quickly.
edit 4: The problem was resolved with speed increase in 10 times(I'm still testing):

      openAnimationConfig={{
          timing: { duration: 280 },
          spring: { speed: 140, bounciness: 5 },
        }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤕 Valid issue Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants