<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Can't scroll page after moving a picture/shape"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=125389#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Can't scroll page after moving a picture/shape"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=125389">bug 125389</a>
              from <span class="vcard"><a class="email" href="mailto:tml@iki.fi" title="Tor Lillqvist <tml@iki.fi>"> <span class="fn">Tor Lillqvist</span></a>
</span></b>
        <pre>The problem seems to be caused by an uncaught exception in the
getMousePosition() function in L.DomEvent in loleaflet/src/dom/DomEvent.js.
When it is called at the end of the drag moving the image, e.touches has zero
length, so trying to use e.touches[0] causes an exception. I changed it to use
e.changedTouches instead. Not sure whether it makes any sense, but at least it
makes the problem go away.

The caller of getMousePosition() is mouseEventToContainerPoint() in
loleaflet/src/map/Map.js, and the caller of that is _onDragEnd() in
L.Handler.PathDrag in loleaflet/plugins/path-transform/src/Path.Drag.js. All
the lines of code that _onDragEnd() would have executed after calling
mouseEventToContainerPoint() get skipped because of the exception. Presumably
it is those lines of code that are supposed to reinstate the normal scrolling
behaviour.

Likely it does not make sense to call mouseEventToContainerPoint() in that
_onDragEnd() as a touchend event by definition is fired when the touch has
finished, and there no longer is any current "mouse" position. w3schools.com
says "The touches property returns an array of Touch objects, one for each
finger that is currently touching the surface", and as the touch has ended, no
finger is touching the surface any longer. Or is this browser dependent?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>