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.

Modal don't close on android

See original GitHub issue

Hello,

The modal don’t want to close on android when i try to update the state of my parent component. Here is my code :

Children component :

<ModalSelector
            data={data}
            initValue="Référence dalle"
            cancelText={"Annuler"}
            animationType="none"
            onChange={item => {
              this.setState({ selected_item: item.key });
              this.props.setState("test", "test");
            }}
          />

Parent component :

  _setState(name, value) {
    console.log(name + " " + value);
    this.setState({ [name]: value });
  }
<InputSlabReference
              slab_ref={this.state.slab_ref}
              setState={this._setState}
/>

But if i do the following, it’s working :

<ModalSelector
            data={data}
            initValue="Référence dalle"
            cancelText={"Annuler"}
            animationType="none"
            onChange={item => {
              this.setState({ selected_item: item.key });
            }}
          />

Can somebody explain to me what I’m doing wrong?

Thanks 😃

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
peacechencommented, Jul 18, 2018

Good investigating. Does that library have a conflict with the built-in React Native modal? This library uses that internally.

I noticed this in the react-native-simple-radio-button source code:

if (Platform.OS === 'android') {
  UIManager.setLayoutAnimationEnabledExperimental && 
  UIManager.setLayoutAnimationEnabledExperimental(true);
}

Try to comment that out and see if it fixes your issue.

0reactions
vitorsgomescommented, Nov 30, 2018

I facing the same issue here, what I’m doing is to disable the animation until it gets fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: Modal screen is not closing with a tap
The issue is that the modal screen can't be closed on Android emulator (mimicing a tap with a left mouse click). Tried to...
Read more >
Prevent Modal being closed with Android Hardware button
In the Page but it doesn't seem to fire. I've tried using. public override void OnBackPressed (). In the MainActivity but I can't...
Read more >
How to avoid the hardware back button to close a modal view ...
Hey Guys, do you know how to avoid in Android the hardware back button to close a modal view? Thank you. Remove overlay...
Read more >
Modal - Bootstrap
Clicking on the modal “backdrop” will automatically close the modal. Bootstrap only supports one modal window at a time. Nested modals aren't supported...
Read more >
Video doesn't stop after closing modal - Bootstrap Studio Forum
I have a modal with a embedded video on https://videoposters.nl. It works quite well but there is one issue. When I close the...
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