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

Uncaught TypeError: L.DomEvent.fakeStop is not a function #48

Open
jet112 opened this issue Jan 12, 2023 · 3 comments
Open

Uncaught TypeError: L.DomEvent.fakeStop is not a function #48

jet112 opened this issue Jan 12, 2023 · 3 comments

Comments

@jet112
Copy link

jet112 commented Jan 12, 2023

There is a problem in Google Chrome.
When stop object drugging, two errors fires in Leaflet.Path.Drag module and map stays with disabled dragging.

Uncaught TypeError: L.DomEvent.fakeStop is not a function
    at NewClass._onDragEnd (Path.Drag.js:190:29)
    at HTMLDocument.handler (leaflet-src.js:2553:17)
    
Uncaught TypeError: L.DomEvent.skipped is not a function
    at NewClass.eval (Path.Drag.js:179:20)

This errors occurs because old version of Leaflet.Path.Drag module in dependency ("leaflet-path-drag": "^1.1.0").
It will be great if you will update dependency to: "leaflet-path-drag": "^1.8.0-beta.3" and publish this in npm.

@daric81
Copy link

daric81 commented Feb 16, 2023

I'm having exactly the same issue as @jet112. Are there any plans to bump leaflet-path-drag to 1.8.0-beta.3 as my app is broken ?
Thanks

@jet112
Copy link
Author

jet112 commented Feb 16, 2023

@daric81 here is the way to solve problem:

  1. Create component with userMapEvent hook:
const MapDrawDragFix = () => {
  const map = useMapEvent('mouseup', () => {
      map.dragging.enable()
  } );

  return null
}
  1. Then place this component into MapContainer:
<MapContainer>
   <MapDrawDragFix />
   ...
</MapContainer>

So, you will see error in console, but map dragging will work :)

@daric81
Copy link

daric81 commented Feb 16, 2023

Nice workaround @jet112 in the meantime. Thanks!

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