Closed Bug 419808 Opened 18 years ago Closed 17 years ago

Click inside contenteditable elements does not put the caret cursor at the clicked position but at the beginning of the element.

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9

People

(Reporter: dpopa, Unassigned, NeedInfo)

References

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022604 Minefield/3.0b4pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022604 Minefield/3.0b4pre ID:2008022604 Click inside contenteditable elements does not put the caret cursor at the clicked position but at the beginning of the element. Reproducible: Always Steps to Reproduce: 1.Have 2 contenteditable divs 2.click on the first div 3.click on the second div Actual Results: caret selection is placed at the beginning of the div Expected Results: caret selection is placed at the clicked location Here's a JavaScript workaround: focus the DIV from inside the mousedown event handler div.addEventListener('mousedown', function (event) { //assume the link is direct child of the editable DIV event.target.parentNode.focus(); }
Attachment for testcase and playground.
Blocks: 390278
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Version: unspecified → Trunk
Fixed by the fix for bug 406596.
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
OS: Windows XP → All
Priority: -- → P3
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
This seems to be an issue in 45.0.2. Clicking the content of a content-editable TD, the cursor is not always at the selectionStart or selectionEnd.
Flags: needinfo?(dpopa)
This seems to be an issue in 48.0 as well. Setting draggable="false" on parent <a> anchor tag fixes it.
Still a problem in 58.0b3

this still a problem, in version 66.0.1, demo: http://jsfiddle.net/WC9Fe/3/

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: