Ticket #3428 (closed feature: fixed)

Opened 2 years ago

Last modified 23 months ago

Modifying point features does not stop at mouseup

Reported by: ahocevar Owned by: ahocevar
Priority: minor Milestone: 2.11 Release
Component: Control.DragFeature Version: 2.11 RC1
Keywords: Cc: xavier.mamano@…
State: Pullup

Description

To reproduce:

  1. Open http://openlayers.org/dev/examples/modify-feature.html
  2. Select "draw point" and draw a point
  3. Select "modify feature"
  4. Click the point to select it. After mouseup, move the mouse to somewhere else.
  5. Click and drag the point. Dragging will not stop on mouseup.

This is a regression from 2.10.

Attachments

openlayers-3428.patch Download (1.3 KB) - added by ahocevar 2 years ago.
3428.B1.patch Download (1.0 KB) - added by jorix 2 years ago.

Change History

  Changed 2 years ago by ahocevar

  • owner changed from tschaub to ahocevar
  • status changed from new to assigned

  Changed 2 years ago by ahocevar

This regression is caused by r11845.

Changed 2 years ago by ahocevar

follow-up: ↓ 4   Changed 2 years ago by ahocevar

  • state set to Review
  • component changed from Control.ModifyFeature to Control.DragFeature

The attached patch makes the workflow in the ticket description work as expected again. All tests still pass (but I don't know how to write a unit test assertion that shows the problem that the patch fixes). Thanks for any review.

Changed 2 years ago by jorix

in reply to: ↑ 3   Changed 2 years ago by jorix

  • cc xavier.mamano@… added

Replying to ahocevar:

The attached patch makes the workflow in the ticket description work as expected again. All tests still pass (but I don't know how to write a unit test assertion that shows the problem that the patch fixes). Thanks for any review.

Hi ahocevar,

I investigated about this issue.

There is another problem, try:

  • Starting and stopping drag of a point (or vertex of a line or polygon).
  • mousedown and mouseup (without moving the mouse)
  • mousemove, oops! point moves

openlayers-3428.patch Download does not solve this second problem. But openlayers-3428.patch Download adds a behavior that may be interesting to drag a point without prior selection.

And I think there is another way to fix the bug without using setTimeout. r11845 added the methods clickFeature and clickoutFeature but only for the management of the touch events. So it may condition its use only for this case and this fixes both problems.
See 3428.B1.patch Download

  Changed 2 years ago by ahocevar

@jorix: what you're doing in 3428.B1.patch Download was my first attempt to fix the issue as well, but it breaks the modify-feature.html example on iOS.

  Changed 2 years ago by ahocevar

  • state changed from Review to Commit

Hm. Tested jorix's patch now on both Safari5 (Mac), Safari (iOS Simulator) and Android 2.1, and it seems to fix the issue indeed. Must have been a caching issue on my end when I tested this first. Thanks jorix for the fix!

  Changed 2 years ago by ahocevar

  • status changed from assigned to closed
  • resolution set to fixed

(In [12181]) click handling in the DragFeature control only for touch devices. p=jorix, r=me (closes #3428)

  Changed 2 years ago by ahocevar

  • status changed from closed to reopened
  • state changed from Commit to Pullup
  • resolution fixed deleted

  Changed 2 years ago by jorix

NOTE: After r12181 #3398 no longer fails, I closed as a duplicate.

  Changed 23 months ago by ahocevar

  • status changed from reopened to closed
  • resolution set to fixed

in 2.11-rc2

Note: See TracTickets for help on using tickets.