Closed Bug 1001576 Opened 7 years ago Closed 7 years ago

Page occasionally pans after calling preventDefault in a touchmove handler


(Firefox OS Graveyard :: Gaia::Homescreen, defect)

Not set


(b2g-v2.0 fixed)

Tracking Status
b2g-v2.0 --- fixed


(Reporter: kgrandon, Assigned: kgrandon)



For the vertical homescreen we have a use case where we need to drag and drop icons on the page inside of a scrollable region. We do this by registering touch start/touchmove/touchend handlers. Inside of the touchmove handler we call event.preventDefault() and move the icon to the specified position. Most of the time this works correctly, but about 25% of the time the page will also move as if in a pan action.

I am working on getting a reduced test case for this issue.
1) The preventDefault needs to be called on the first touchmove event for it to have any effect
2) There is a time limit (300ms) to how long APZ will wait to get a response from content before starting the pan. The time it takes for the touch event to be delivered to content, run the handler, and send the response back to the main process is all included here. It might that you're running into this limit - bump up the apz.content_response_timeout pref to something larger to see if that's it. Default value is 300, units are milliseconds.
Thanks for the quick reply. It sounds like we should be able to solve this in content, so I will verify that there really is a bug or that it's impossible to solve in content before we have a platform bug. Moving into homescreen.
Assignee: nobody → kgrandon
Component: Panning and Zooming → Gaia::Homescreen
Product: Core → Firefox OS
One way that we can solve this is by using the contextmenu event that the current homescreen uses. Though this does have the unfortunate long delay, so UX may request that we shorten the context menu delay.
Let's go with contextmenu for now and we can investigate shortening the delay in the future:
Closed: 7 years ago
Resolution: --- → FIXED
Mass modify - set status-b2g-v2.0 fixed for fixed bugs under vertical homescreen dependency tree.
You need to log in before you can comment on or make changes to this bug.