IE dblclick documentation error
|Reported by:||rtpmatt||Owned by:||rtpmatt|
The docs for dblclick say
It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events and others only one. If an interface that reacts differently to single- and double-clicks cannot be avoided, then the dblclick event should be simulated within the click handler. We can achieve this by saving a timestamp in the handler, and then comparing the current time to the saved timestamp on subsequent clicks. If the difference is small enough, we can treat the click as a double-click.
In IE (8 at least) however, the second click even is not fired, only the first click, then a dblclick.
The best solution I have come up with is to use the timer as proposed, but if a dblclick event is fired, have it do what the timer would do in the case of a dblclick, cancel the timer, and return false; There is probably a better way, but that what I have right now.
Sorry if this is not the best place to post a documentation issue.
Change History (7)
comment:5 Changed 5 years ago by dmethvin
- Resolution set to fixed
- Status changed from pending to closed