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

using dynamic snapPoints there is a glitch in the bottom #160

Closed
Piero87 opened this issue Jan 6, 2021 · 8 comments · Fixed by #176
Closed

using dynamic snapPoints there is a glitch in the bottom #160

Piero87 opened this issue Jan 6, 2021 · 8 comments · Fixed by #176
Assignees
Labels
bug Something isn't working v2 Written in Reanimated v1

Comments

@Piero87
Copy link

Piero87 commented Jan 6, 2021

Hello again :D,
I'm trying to use dynamic snapPoints connected to a state, this is the code:

  constructor(props) {
    super(props);
    this.state = {
      snapPoints: [0, 310]
    };
  }

this is the Bottom Sheet component:

      <BottomSheet
        ref={this.bottomSheetRef}
        index={-1}
        snapPoints={this.state.snapPoints}
        backdropComponent={BottomSheetBackdrop}
      >
       ...
     </BottomSheet>

Then on the click you will see in the video attached I do this:

      this.setState({
        snapPoints: [0, 510]
      });

or this:

      this.setState({
        snapPoints: [0, 430]
      });

or this:

      this.setState({
        snapPoints: [0, 310]
      });

And when the BottomSheet move to [0, 310] snapPoints make a glitch on the bottom:

Registrazione.schermo.2021-01-06.alle.21.45.27.mov

I was afraid it was a fault of some of my components so I try a more clean and do the same:

Registrazione.schermo.2021-01-06.alle.21.47.38.mov
Library Version
@gorhom/bottom-sheet 2.0.0
react-native 0.63.3
react-native-reanimated 1.13.2
react-native-gesture-handler 1.9.0
@Piero87 Piero87 added the bug Something isn't working label Jan 6, 2021
@gorhom
Copy link
Owner

gorhom commented Jan 6, 2021

try to set the backgroundComponent with bottom: -100

@gorhom gorhom added the v2 Written in Reanimated v1 label Jan 7, 2021
@Piero87
Copy link
Author

Piero87 commented Jan 7, 2021

@gorhom I have tried but I don't see any difference, can you give me an example?

@gorhom
Copy link
Owner

gorhom commented Jan 7, 2021

@Piero87 okay I'll prepare something later 👍

@gorhom gorhom self-assigned this Jan 7, 2021
@Piero87
Copy link
Author

Piero87 commented Jan 7, 2021

thank you 🙏

@Piero87
Copy link
Author

Piero87 commented Jan 10, 2021

@gorhom have you closed because it's fixed?

@gorhom
Copy link
Owner

gorhom commented Jan 11, 2021

this should be resolved with 3.1.0 & 2.0.3 👍

@Piero87
Copy link
Author

Piero87 commented Jan 11, 2021

@gorhom Yes it's fixed, thank you.
I take this opportunity to ask you something else about the snapPoint field, I have a button in the bottom of the sheets, that have this styles:

  base: {
    position: 'absolute',
    bottom: 0,
    width: Dimensions.get('window'),
    height: 80,
  },

And this is where I insert it:

      <BottomSheet
        ref={this.bottomSheetRef}
        index={-1}
        snapPoints={snapPoints}
        onChange={this.onBottomSheetChange}
        backdropComponent={BottomSheetBackdrop}
>
<ButtonFullScreen />
</BottomSheet>

And when I change the snapPoints from the higher to the lowest value:

Registrazione.schermo.2021-01-12.alle.00.39.02.mov

As you can see goes up and then return in position, you know how can I fix this?

@iamnafri
Copy link

iamnafri commented Nov 8, 2021

@gorhom Yes it's fixed, thank you. I take this opportunity to ask you something else about the snapPoint field, I have a button in the bottom of the sheets, that have this styles:

  base: {
    position: 'absolute',
    bottom: 0,
    width: Dimensions.get('window'),
    height: 80,
  },

And this is where I insert it:

      <BottomSheet
        ref={this.bottomSheetRef}
        index={-1}
        snapPoints={snapPoints}
        onChange={this.onBottomSheetChange}
        backdropComponent={BottomSheetBackdrop}
>
<ButtonFullScreen />
</BottomSheet>

And when I change the snapPoints from the higher to the lowest value:
Registrazione.schermo.2021-01-12.alle.00.39.02.mov

As you can see goes up and then return in position, you know how can I fix this?

@Piero87 did you find a solution regarding this?
I faced the same issue in v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Written in Reanimated v1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants