Given the following HTML:
<div contenteditable="true">Some text</div>
And some JS which detects the click event with JQuery:
$("div").click(function() {
alert('click!');
});
If you select a portion of the text in the div, the click event will not be thrown by Opera (tested with Opera 11.61 on Linux and 11.62 on Windows). Double-clicking a word to partially mark it does work.
The event is thrown in IE7-9, Firefox, Chrome and Safari. There is a slightly modified JSFiddle here.
Is this expected behavior, a JQuery bug, an Opera bug, or something else?
mousedown
ormouseup
as a workaround? – Krummmouseup
works jsfiddle.net/4yNxs/4 – Wickner