React-native-modal: Change the backdrop start height to be under navigation bar.

Created on 18 Apr 2018  路  4Comments  路  Source: react-native-modal/react-native-modal

I'm trying to figure out the best way to get the backdrop to start under the navigation bar, as there are items on our navigation bar that we want the user to continue to be able to interact with while the modal is loaded.

We're already using onLayout to get the height of our header and adjusting our modal's styling based on that value. I've tried adjusting the style prop for the react-native-modal component to use absolute positioning, but that didn't work. I've also tried adjusting the marginTop property.

question

Most helpful comment

@ChristianTucker What did you do to achieve this? I am working on an app where I want 2 buttons to still be clickable over the backdrop.

All 4 comments

Well, if you look at the code, it's really not possible at the moment -- it uses the device's width/height. I really don't have time for a PR right now, when/if I do I'd make one. :/

Hey!
I would strongly suggest against keeping the toolbar active while showing the (react-native) modal.
Imho it would be better using a completely JS solution.

P.S.: If you're interested I'm porting react-native-modal to a fully JS lib. I'm opening an issue for it.

@mmazzarolo We were using the modal implementation in-place of a Drawer navigator. Therefor keeping the toolbar active is definitely ideal for our situation. However I've already made the appropriate modifications for this to work. This was just preference opposed to something like react-native-drawer.

Example

Ignore the placeholder UI elements, this was a gif of before we fixed it, but just to show you why we wanted it.

@ChristianTucker What did you do to achieve this? I am working on an app where I want 2 buttons to still be clickable over the backdrop.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haveamission picture haveamission  路  3Comments

mmazzarolo picture mmazzarolo  路  4Comments

stonepreston picture stonepreston  路  4Comments

ODelibalta picture ODelibalta  路  3Comments

HoaiHuynh picture HoaiHuynh  路  3Comments