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

[Bug]: On Android, onLongPress function is working only once(initial render) #3715

Open
vaishnavi-techp opened this issue Dec 5, 2024 · 5 comments
Labels
bug 🪲 Something isn't working

Comments

@vaishnavi-techp
Copy link

vaishnavi-techp commented Dec 5, 2024

Mapbox Implementation

Mapbox

Mapbox Version

10.1.32

React Native Version

0.74.5

Platform

Android

@rnmapbox/maps version

10.0.0-beta.32

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}   onLongPress={() => console.log("long press")}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

onLongPress is triggered only once (during the initial render) on Android, but works as expected on iOS.

Expected behavior

onLongPress should be triggered whenever the user performs a long press on the map.

Notes / preliminary analysis

No response

Additional links and references

No response

@youtipie
Copy link

youtipie commented Dec 9, 2024

+1

@bitkraft-ssheikh
Copy link

I am facing the same issue.

@jayjo34
Copy link

jayjo34 commented Dec 19, 2024

Mee too

@prashantsail
Copy link

I am running into this issue as well. Is there a workaround available ?

@yashp1998
Copy link

I am facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants