colorfy-software / react-native-modalfy

🥞 Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.08k stars 44 forks source link

Width of stacked modals #18

Closed ahartzog closed 4 years ago

ahartzog commented 4 years ago

Hey guys,

Absolutely love what this library has to offer. I figured rather than writing out questions on reddit I should put them here where they could come in handy to other people.

I have a stack of modals and I'm trying to figure out why there's some sort of nesting of the margin/padding going on

MP4 video if the nesting issue --> https://imgur.com/a/KSk8R5m

It seems like each successive modal stacked on top of the first one bases it's sizing off the first modal, maybe? Or there's some odd margin/padding effect I'm not thinking of?

Here's another example, where the first modal behind is full width, and then the next modal (which I would ideally like to just sit perfectly on top of the first one) is some odd set of it's width.

image

Goofing around with the inspector - it appears to be some sort of width calculation - so I'm thinking I can just use the windowWidth minus appropriate margins to set width here if needed - but thought this might be worth posting in case some other more elegant solution is obvious.

Thanks!

ahartzog commented 4 years ago

Ah yep - I just need to explicitly specify the width of my modals. Nothing wrong with the lib.

image

CharlesMangwa commented 4 years ago

Hey @ahartzog! Thanks for the kind words, very much appreciated!

I was literally about to suggest you doublecheck how you set the modals width! 😄

Glad to see that you're enjoying Modalfy so far!