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

SearchControl.ts:414 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'draggable') #325

Open
richsims opened this issue May 10, 2022 · 1 comment

Comments

@richsims
Copy link

Hello,

I'm using leaflet 1.8.0, react-leaflet 3.2.5 and the latest version of leaflet-geosearch.

It used to work fine, but despite not changing the versions of any of the dependencies (I know! somehow I must have done!) I now get the following error when doing a search:

SearchControl.ts:414 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'draggable')
at NewClass.addMarker (SearchControl.ts:414:1)
at NewClass.showResult (SearchControl.ts:382:1)
at SearchControl.ts:369:1

NOTE: in the network panel I can see the search to the googlemaps API being made, and a valid response coming back.

It used to show a list of the results underneath the search bar, but nothing now comes up.

I've tried various browsers, versions of leaftlet/react-leaflet and leaflet-geosearch but always now end-up with the same error.

Any thoughts? I'm a bit stuck.

Rich

@lelumees
Copy link

lelumees commented Jun 2, 2022

Same here, looks like some internal issues, although I faced it after React upgrade from 16 to 17. I solved it by providing a marker prop (could be an empty object as well I suppose) during SearchControl initialisation:

const searchControl = SearchControl({
  provider,
  // ...
  marker: {
    draggable: false,
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants