Coder Social home page Coder Social logo

Comments (10)

WildSpy avatar WildSpy commented on July 28, 2024 3

I invented super-crutch :)

make ref of a View in contentRender. I called it contentRef.

this is a try to define if panel is in wrong place and hide it.
'top' is a top snapPoint

function crutch() {
      contentRef.current.measure((width, height, px, py, fx, fy) => {
        if (fy < top) {
          return hidePanel();
        }
      });
}

but it not always work, that's why i do this in componentDidMount

      if (Platform.OS === 'android') {
        // SUPERMEGA CRUTCH for Android
        const timerId = setInterval(crutch, 300);
        setTimeout(() => {
          clearInterval(timerId);
        }, 2000);
      }

i know it's terrible :(
but it works in my сase.
waiting for the fix from the author

from react-native-reanimated-bottom-sheet.

WVandergrift avatar WVandergrift commented on July 28, 2024 2

Here's what I ended up doing that has been working consistently so far (YMMV). I set the initial snap to the last snap point index. When the component mounts, I then set the desired snap position.

  componentDidMount() {
    // This is a shim to prevent the bottom sheet from occassionaly not rendering correctly.
    // https://github.com/osdnk/react-native-reanimated-bottom-sheet/issues/51
    this.bottomSheet.snapTo(1);
  }
        <BottomSheet
          ref={ref => { this.bottomSheet = ref; }}
          snapPoints={[420, 210, 40]}
          renderContent={this.renderPanelInner}
          renderHeader={this.renderPanelHeader}
          initialSnap={2}
          enabledInnerScrolling={false} />

Hopefully this will help someone else out until we can get an official fix.

from react-native-reanimated-bottom-sheet.

nosalvage avatar nosalvage commented on July 28, 2024

The same issue, please help

from react-native-reanimated-bottom-sheet.

JakeHadley avatar JakeHadley commented on July 28, 2024

@WildSpy I'm trying to discover if I'm seeing this as well. It's not showing up but I don't know how to see if it's not rendering or if its just behind everything. How did you get it to show up on the inspector?

from react-native-reanimated-bottom-sheet.

WildSpy avatar WildSpy commented on July 28, 2024

@pianoman730 As i see it's not behind everything, because i can click on it in inspector. Just very strange behavior.

from react-native-reanimated-bottom-sheet.

OwlHaus avatar OwlHaus commented on July 28, 2024

I had this similar issue, and for me, it was related to the it's location in the hierarchy, such that the bottom sheet had to be placed above all components for which is may overlay. I know this sounds weird, and may not be your problem, but something to consider

from react-native-reanimated-bottom-sheet.

ardyfeb avatar ardyfeb commented on July 28, 2024

I have same issue, how to solve this?

from react-native-reanimated-bottom-sheet.

tudormarze avatar tudormarze commented on July 28, 2024

For me, this issue happened also with only two snap points, top and bottom :/
@WildSpy 's solution worked for me, thank you!

from react-native-reanimated-bottom-sheet.

solace avatar solace commented on July 28, 2024

I conditionally render the bottom sheet and @WVandergrift's solution worked for me.

from react-native-reanimated-bottom-sheet.

BogdanTaranenko avatar BogdanTaranenko commented on July 28, 2024

any progress?

from react-native-reanimated-bottom-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.