Ticket #656 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Click event fired when the map is dragged

Reported by: openlayers Owned by:
Priority: minor Milestone:
Component: Map Version: 2.4 RC1
Keywords: Cc:
State:

Description

Dragging a map causes the click event to be fired. This was not the case in 2.3, and my understanding is that it should not be the case now either.

I have attached html files demonstrating the problem. A click event causes an alert to be shown. This alert is shown when dragging the map on the current and 2.4-rc1 versions, but not on the 2.3 version.

Attachments

OpenLayersTest3.html Download (1.4 KB) - added by openlayers 6 years ago.
Test case using 2.4-rc1 on openlayers.org
OpenLayersTest4.html Download (1.4 KB) - added by openlayers 6 years ago.
Test case using 2.3 on openlayers.org
DragClick.patch Download (0.8 KB) - added by openlayers 6 years ago.
Fix to Handler/Drag.js

Change History

Changed 6 years ago by openlayers

Test case using 2.4-rc1 on openlayers.org

Changed 6 years ago by openlayers

Test case using 2.3 on openlayers.org

Changed 6 years ago by openlayers

I am going to attach a patch that fixes this for me on IE7 Windows and Firefox 2.0.0.3 Windows. It does two things:

  1. Switches the behavior of the if statement in the click event, which (unless I'm missing something) was obviously incorrect.
  2. Removes the isLeftClick check from that if statement. I did this because the click event on IE doesn't seem to contain a valid value for the button. I don't know if this will cause a problem if multiple buttons are pressed simultaneously, but it doesn't seem to in my brief and informal testing.

Changed 6 years ago by openlayers

Fix to Handler/Drag.js

Changed 6 years ago by sderle

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

fixed by r3082

Note: See TracTickets for help on using tickets.