Skip to content

Commit

Permalink
fix: TypeError on Firefox
Browse files Browse the repository at this point in the history
in Firefox when moving a marker a TypeError was thrown with:
invalid 'instanceof' operand window.TouchEvent

this just needs to separate the move event from the component from the
internal 'move' event fired afterwards so it doesn't loop.
This is now done by checking if originalEvent exists and checking its type
  • Loading branch information
TheGreatRefrigerator committed Jun 6, 2024
1 parent 614fee6 commit 851cfdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fragments/map-view/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ export default {
// Only marker changes that are a result of user interaction are treated here.
// With vue2-leaflet version 2.5.2 the event.originalEvent is not an instance of
// window.PointerEvent anymore and use parent window.MouseEvent instead
if (event.originalEvent instanceof window.MouseEvent || event.originalEvent instanceof window.TouchEvent) {
if (event.originalEvent?.type === 'mousemove') {
clearTimeout(this.markerMoveTimeoutId)
this.markerMoveTimeoutId = setTimeout(() => {
this.markerDragEnd(event)
Expand Down

0 comments on commit 851cfdb

Please sign in to comment.