Skip to content

Commit 851cfdb

Browse files
fix: TypeError on Firefox
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
1 parent 614fee6 commit 851cfdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fragments/map-view/map-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ export default {
949949
// Only marker changes that are a result of user interaction are treated here.
950950
// With vue2-leaflet version 2.5.2 the event.originalEvent is not an instance of
951951
// window.PointerEvent anymore and use parent window.MouseEvent instead
952-
if (event.originalEvent instanceof window.MouseEvent || event.originalEvent instanceof window.TouchEvent) {
952+
if (event.originalEvent?.type === 'mousemove') {
953953
clearTimeout(this.markerMoveTimeoutId)
954954
this.markerMoveTimeoutId = setTimeout(() => {
955955
this.markerDragEnd(event)

0 commit comments

Comments
 (0)