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.

[Android] modal disappeares when opening share

See original GitHub issue

I have screen and on that screen modal, modal has a share button, clicking on button Simple Share is open, but first the modal disappeares and screen beneath is shown… This is only case on android, iOS shows correctly. Adding code and screen shot…

export default class Screen extends Component {
    constructor(){
        super();
    }

    render() {
        return (
            <View style={styles.container}>
                <Text style={{color: '#fff'}}>Main Page</Text>
                <Modal style={styles.container}
                    visible={true}
                    transparent={false}
                    supportedOrientations={['portrait', 'landscape']}
                    onRequestClose={() => {}}>
                    <TouchableOpacity
                        onPress={() => {
                            let shareOptions = {
                                title: "Example share",
                                message: "Example share",
                                url: "http://example.com",
                                subject: "Example share" //  for email
                              };

                            Share.open(shareOptions);
                        }}
                    ><Text>Share button on modal</Text></TouchableOpacity>
                </Modal>
            </View>
        );
    }
}

unity

Any input would be appreciated…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zmax92commented, Jul 5, 2018

@kkbhav I am using 0.52.2 react-native, after updating to 0.56.0 react-native issue is resolved… thank you

1reaction
kkbhavcommented, Jul 5, 2018

@zmax92 @jgcmarins I tried the above code and I am not experiencing the mentioned issues. I think this is the issue with react-native.
@zmax92 what version of react-native are you using. Can you check this issue on latest version of react-native, if it is replicating or not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent modal window from disappearing on screen ...
Despite modal is not visible, underlying view is non-responsive to scroll or tap, as if modal was still there. To get rid of...
Read more >
Modal Closes on Touch for stock Android Browser #12888
When you open a modal in the stock android browser the user can't touch a form or anything because it automatically closes like...
Read more >
Permissions updates in Android 11 - Android Developers
One-time permissions. Starting in Android 11, whenever your app requests a permission related to location, microphone, or camera, the user-facing permissions ...
Read more >
Restoring ActiveElement Focus After A User-Interaction In ...
However, if the user closes the modal window, we would like to ... <button>Open modal (1)</button> , <button>Open modal (2)</button> ,.
Read more >
10 Most Common Bootstrap Mistakes That Developers Make
The best practice is to place a modal's HTML just before the closing </body> tag, or even better in a top-level position in...
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