question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overlay style not working as expected

See original GitHub issue

Trying to recreate the bottom half screen popup card you see on Google Maps when you tap on a pin but can’t make it work with Overlay. More specifically, I cannot seem to position the Overlay off-center at all. With the native Modal I am able to set justifyContent: ‘flex-end’ to generate something 90% similar (still haven’t figured out how to allow interaction with the content outside of the modal without closing the modal).

Code

        <Modal style={styles.bottomModal}
          backdropColor={'transparent'}
          transparent
        >
          {this._renderModalContent()}
        </Modal>
        <Overlay overlayStyle={styles.bottomModal}
          backdropColor={'transparent'}
        >
          {this._renderModalContent()}
        </Overlay>

Style

const styles = StyleSheet.create({
  bottomModal: {
    justifyContent: 'flex-end',
    margin: 0,
  },
});

Here’s the snack: https://snack.expo.io/rkJcCSZfL

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
flyingcirclecommented, Apr 27, 2020

There is also the fact that RNE uses the react-native Modal but your snack uses the react-native-modal Modal. So you are using 2 different modals. In RNE 2.0.0, they added the prop ModalComponent to Overlay to pass in a custom Modal, but even with that, I haven’t been able to get the animation working. But I still don’t see this question answered. If you are already using react-native-modal, what is the value add from the Overlay component?

1reaction
seanfarcommented, Feb 21, 2020

@iqbalfaisal I can confirm that containerStyle is/was not being consumed as expected. Rather, it’s the style being applied to the backdrop. This isn’t useful, as the backdrop is not a parent/container to the actual View element containing the modal. See the commit HERE and you can see what I’m talking about, this prop was actually renamed to backdropStyle.

The container element you would expect the containerStyle prop to be applied to is actually only using the internal stylesheets container. This seems like an oversight, I would expect a containerStyle prop to be merged into the styles for that element on line 39

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - Hover function and rendering not working as expected ...
I'd like my image to show an overlay upon hover that 1. is same size/dimension 2. has a bg color with opacity and...
Read more >
Tikz overlay not working as expected - LaTeX Stack Exchange
I am using pdflatex to convert following code into a pdf, and I do not get the expected overlay. \begin{lstlisting}[language=nasm,style=nasm, ...
Read more >
Overlay layer not working when loading page first time
But since a few days I am facing a strange behavior. I created a slider with an overlay layer showing some text on...
Read more >
Color mode (multiply) for image overlay - E-Learning Heroes
I need to overlay 2 images, the top one with overlay mode. I noticed this isn't working as it should. The top image...
Read more >
Issue with sliding overlay nav bar with custom CSS - Questions
The problem is that the sliding panel doesn't behave like expected: instead of overlays the canvas it pushes it and resizing it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found