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

modal does not transparent in iPhone 11 #64

Closed
ananiy opened this issue Apr 22, 2020 · 7 comments
Closed

modal does not transparent in iPhone 11 #64

ananiy opened this issue Apr 22, 2020 · 7 comments

Comments

@ananiy
Copy link

ananiy commented Apr 22, 2020

import React from 'react'

import styled from 'styled-components/native'
import useMount from 'react-use/lib/useMount'

import { Modal } from 'react-native'
import RootSiblings from 'react-native-root-siblings'

const View = styled.View`
  flex: 1;
  background: rgba(255, 255, 0, 0.5);
  justify-content: center;
  align-items: center;
`

const View2 = styled(View)`
  background: #f0f;
`

const Text = styled.Text``

export const Test = () => {
  useMount(() => {
    new RootSiblings(
      (
        <Modal visible transparent={true}>
          <View>
            <Text>Test</Text>
          </View>
        </Modal>
      ),
    )
  })
  return (
    <View2>
      <Text>hello</Text>
    </View2>
  )
}
{
  "react-native": "^0.61.5",
  "react-native-root-siblings": "^4.0.6",
}

in iPhone 6:
IMG_0527

in iPhone 11:
IMG_1586

@sunnylqm
Copy link
Collaborator

Why use modal inside a rootsibling? ... Rootsibling itself is a modal

@ananiy
Copy link
Author

ananiy commented Apr 23, 2020

Why use modal inside a rootsibling? ... Rootsibling itself is a modal

Rootsibling isn't fullscreen, I just want use like:

const modal = new Rootsibling(<Modal>{...}</Modal>)

btn.onClick = () => modal.destory()

@sunnylqm
Copy link
Collaborator

sunnylqm commented Apr 23, 2020

Just make a view that has a full screen style(StyleSheet.absoluteFillObject). Modal has a lot of bugs.

@ananiy
Copy link
Author

ananiy commented Apr 29, 2020

Just make a view that has a full screen style(StyleSheet.absoluteFillObject). Modal has a lot of bugs.

My rn code in a native app by another team, so I must use native navigation, Rootsibling using full screen style can't cover native navigation, but Rootsibling with Modal could do it.

So I have this problem~

@sunnylqm
Copy link
Collaborator

sunnylqm commented Apr 29, 2020

I still don't get the point.
Is there any native ui in your rn view?
If No then RootSibling should be ok to cover any views (maybe with an additional RootSiblingParent wrapper #52 (comment)).
If Yes then could you try Modal without RootSibling to confirm where the issue might come from?

@ananiy
Copy link
Author

ananiy commented Apr 29, 2020

I still don't get the point.
Is there any native ui in your rn view?
If No then RootSibling should be ok to cover any views (maybe with an additional RootSiblingParent wrapper #52 (comment)).
If Yes then could you try Modal without RootSibling to confirm where the issue might come from?

Yeah, there is a native navigation in my rn view, so RootSibling not cover my screen.

My problem is, this use case is ok in iphone 6 but not in iphone 11, thx

@sunnylqm
Copy link
Collaborator

I would not consider a native navigation an inner native ui since usually it's kind of a parent container. In this case rootsiblings would work with a parent mount point which i have mentioned above.
If that is not the case, then try modal without rootsiblings then we can know which one caused your issue.

@ananiy ananiy closed this as completed Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants