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.

onBackdropPress not trigger

See original GitHub issue

Environment

System: OS: macOS 10.15.5 CPU: (4) x64 Intel® Core™ i5-5287U CPU @ 2.90GHz Memory: 27.93 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.2 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.1 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64 IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 11.6/11E708 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.0 => 0.61.0 npmGlobalPackages: react-native-cli: 2.0.1

Platforms

I try in Android, i dont know how in ios.

Versions

  • Android:
  • iOS:
  • react-native-modal: 11.5.6
  • react-native: 0.61.0
  • react: 16.9.0

Description

I try to close modal when user press back drop, but the prop onBackdropPress not trigger.

Reproducible Demo

<Modal
  useNativeDriver={true}
  animationIn={'fadeIn'}
  animationOut={'fadeOut'}
  backdropColor={'rgba(0, 0, 0, 0.7)'}
  backdropOpacity={0.5}
  isVisible={this.props.isOpenConsultant}
  onSwipeComplete={() => this.props.close()}
  swipeDirection={['down']}
  style={{ justifyContent: 'flex-end', margin: 0 }}
  onBackButtonPress={() => this.props.close()}
  onBackdropPress={() => console.log('Hello')}>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

34reactions
QingyuChaicommented, Aug 19, 2020

Make sure the child component of the modal does not have { flex:1 }, as that seems to overwrite the touch trigger.

10reactions
rebirthtobicommented, Aug 22, 2020

Also experiencing the same thing, there is no { flex: 1 } in the child component

Read more comments on GitHub >

github_iconTop Results From Across the Web

Close react native modal by clicking on overlay?
I use TouchableWithoutFeedback since i do not want to change the background color when clicking on it. I also added onStartShouldSetResponder on the...
Read more >
Modal - React Native
The Modal component is a basic way to present content above an enclosing view.
Read more >
“react native modal on backdrop press not working” Code ...
“react native modal on backdrop press not working” Code Answer ... show modal by using id in list react · trigger modal after...
Read more >
react-native-modal - npm
The custom backdrop doesn't dismiss the modal on press. You can provide an event handler to the custom backdrop element to dismiss the...
Read more >
React Native Modals | The Widlarz Group Website
onBackdropPress - function called on backdrop press,; onSwipeComplete - function called when swipe is complete,; swipeDirection - direction ...
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