[OpenLayers-Trac] [OpenLayers] #2993: box handler cancels click

OpenLayers trac-20090302 at openlayers.org
Mon Jan 3 08:16:31 EST 2011


#2993: box handler cancels click
-------------------------+--------------------------------------------------
 Reporter:  pgiraud      |       Owner:  pgiraud     
     Type:  bug          |      Status:  new         
 Priority:  major        |   Milestone:  2.11 Release
Component:  Handler.Box  |     Version:  2.10        
 Keywords:               |       State:  Review      
-------------------------+--------------------------------------------------
 Since the [http://trac.osgeo.org/openlayers/changeset/10871 revision
 10871], the box handler prevents the click events from being triggered.

 As said almost everywhere "The click event occurs when the pointing device
 button is clicked over an element. A click is defined as a mousedown and
 mouseup over the same screen location.". This means that "mousedown" and
 "mouseup" have to occur on the same element.

 In our case, when "mousedown" is triggered, the box handler creates a new
 div element which is appended under the mouse cursor. When "mouseup" is
 triggered, the event target is not the same. The "click" event is not
 triggered.

 Before the changeset, the box was positioned with a tiny offset. Now that
 positioning is better, the box div is exactly under the mouse.

 A straight way to solve the issue is to position the box under the cursor
 only once the latter is actually moved.

 Attached is a patch, and an example to manually test the issue.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2993>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list