Bug 125389 - Can't scroll page after moving a picture/shape
Summary: Can't scroll page after moving a picture/shape
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other iOS
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-20 13:20 UTC by Nicolas Christener
Modified: 2019-05-30 13:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Video demonstrating the issue (1019.48 KB, video/mp4)
2019-05-20 13:28 UTC, Nicolas Christener
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Christener 2019-05-20 13:20:48 UTC
Description:
After moving a picture (or shape) in a writer document in the iOS app the page can't be moved anymore.

Steps to Reproduce:
1. Write some text in the iOS app, scroll the page using the finger
2. Insert a picture or a shape and move it on the page
3. Try to scroll the page

Actual Results:
The page can't be moved with the finger.

Expected Results:
The page can't be moved with the finger.


Reproducible: Always


User Profile Reset: No



Additional Info:
I'll upload a video that shows the issue.
Comment 1 Nicolas Christener 2019-05-20 13:28:32 UTC
Created attachment 151534 [details]
Video demonstrating the issue

This happens with pictures and also with shapes. In the case of shapes, it often happens, that additional shapes are pasted.
Comment 2 How can I remove my account? 2019-05-21 13:36:42 UTC
Looking at this now.
Comment 3 How can I remove my account? 2019-05-21 13:50:27 UTC
The same problem is visible also in Safari on iOS against normal Online.
Comment 4 How can I remove my account? 2019-05-30 13:30:12 UTC
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?
Comment 5 Commit Notification 2019-05-30 13:33:40 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/+/6478015ccbf7ee49b026820960edac4401334cd2%5E%21

tdf#125389: Guard against exception if e.touches is zero length