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.

Bug Report: On Press is not working for android device or emulator

See original GitHub issue

On Press is not working for android device or emulator

Hi,

On Press is not working for android device or emulator. I using it in modal but also tried in plain view or scrollview both. I have been looking for solution last couple of days. I went through some other devs also mentioned the similar problem. They purposed the solution might be enabling billing configurations, some said remove it from scrollview. I tried both, none worked for me.

In IOS emulator it’s working fine, onPress is also working. In android, search works but when pressing on item from search result, nothing happens and list disappears.

Any help will be appreciated. Thank You. 😃

Reproduction

GPlace Component
<GooglePlacesAutocomplete
  placeholder="Search"
  query={{
    key: GOOGLE_PLACES_API_KEY,
    language: "en", // language of the results
  }}
  onPress={(data, details = null) => {
    console.log(data, details);

    setFieldValue(name, data.description);
    setModalVisible(false);
  }}
  onFail={(error) => console.error(error)}
  requestUrl={{
    url: "https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api",
    useOnPlatform: "web",
  }} // this in only required for use on the web. See https://git.io/JflFv more for details.
/>
Modal Component
<Modal visible={modalVisible} animationType="slide">
  <ScreenWithoutScroll
    style={{
      flex: 1,
      padding: 10,
      backgroundColor: defaultStyles.colors.light,
    }}
    >
  <Button title="Close" onPress={() => setModalVisible(false)} />
  
  <GPlace name={name} setModalVisible={setModalVisible} />
  </ScreenWithoutScroll>
</Modal>

Additional context

  • Library Version: 2.4.1

  • React Native Version: 0.64.3

  • iOS

  • Android

  • Web

  • I am using expo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

11reactions
bunemecommented, Feb 12, 2022

I had this issue when using the component in a scrollview - adding keyboardShouldPersistTaps={"always"} to the scrollview fixed it for me.

2reactions
zubairniazi94commented, Dec 24, 2021

Hi @bell-steven

My apologies for late reply. Actually I got it working without scrollview.

Let me explain:

I have a form in ScrollView component. In the form, I have a field that opens Modal which is not ScrollView. When I removed ScrollView from form component then it’s working on android too. I guess it has some issue with ScrollView component.

I have a huge form component that will not fit into screen so I have to add ScrollView component. I’m sharing expo link so you can get the idea.

Link: https://expo.dev/@zubairniazi/ScheduleApp

Thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capture and read bug reports - Android Developers
A bug report contains device logs, stack traces, and other diagnostic information to help you find and fix bugs in your app.
Read more >
Generate Bug Report on Android Devices - Tech Blogs
1. Capturing a bug report from a device. · 2. Capturing the bug report from an Android Emulator. · 3. Capturing the bug...
Read more >
Take Bug Report for Android - YouTube
How to take a developer bug report for Android, as well as enable bug reports, developer options and bug reports from the device...
Read more >
Could not connect to development server on android emulator ...
The project is expected to run on emulator and phone without any error. But instead i got the error and i have tried...
Read more >
ERROR Android emulator gets killed in Android Studio
Install and reinstall HAXM 7.5.6 (only available version) under 'Android SDK' settings. Try downloading it manually, even other versions (they don't work with ......
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