Caret doesn't move to beginning or ending of div w/ contenteditable = true with repeated left / right arrow keys

NEW
Assigned to

Status

()

11 years ago
10 years ago

People

(Reporter: rpaplin, Assigned: peterv)

Tracking

unspecified
x86
Windows Vista
Points:
---
Bug Flags:
wanted1.9.1 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0

The page listed above has a DIV with a contenteditable = true attribute. The
DIV contains several spans with a contenteditable = false attribute. When I set
the caret to an editable region inside the To field (a/k/a DIV with
contenteditable = true), and repeatedly press the left or right arrow key, the caret doesn't move to beginning or the end of the field like I expect it should.



Reproducible: Always

Steps to Reproduce:
1. Set the caret to a semicolon between names in the To... field
2. Press the left arrow key repeatedly until the caret stops moving
3. Note where the caret stops moving (at the end of the first name, 
4. Set the caret to a semicolon between names in the To... field (like you did
in Step 1)
5. Press the right arrow key repeatedly until the caret stops moving
6. Note where the caret stops moving

Actual Results:  
At step 3, the caret stops moving before it hits the beginning of the
contenteditable DIV. (aka before the first name)

At step 6, the caret stops moving before it hits the end of the
contenteditable DIV. (aka after the last name)

Expected Results:  
At step 3, the caret should stop moving at the beginning of the contenteditable DIV in the left arrow case (aka before the first name / Tom Brady).

At step 6, the caret should stop moving at the ending of the contenteditable DIV in the right arrow case. (aka after the last name / Eli Manning).

The caret should keep moving to the left or right until it is at the beginning or ending of the contenteditable div. After reaching the div boundary, additional left or right arrow key events should be ignored (like a <input type=text> or <textarea> element would act).

The caret should stop moving at the same location after repeated left arrow keys as it does with a Home key.

The caret should stop moving at the same location after repeated right arrow keys as it does with an End key.

Even though, the left/right arrow key stops moving the caret before the begining or ending of the editable region, the caret will still move via the Home key when it's located right after the beginning and will still move via the End key when it's located right before the end.

This bug is related to 423523.

This test case works as expected in MS IE 7.
(Reporter)

Comment 1

11 years ago
Created attachment 322693 [details]
Caret inside contenteditable DIV doesn't handle keyboard navigation correctly
(Reporter)

Updated

11 years ago
Depends on: 423523

Comment 2

11 years ago
Seeing this on Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052606 Minefield/3.0pre
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

11 years ago
Assignee: nobody → peterv
(Assignee)

Comment 3

11 years ago
Created attachment 323009 [details] [diff] [review]
v1

This works, but I'm looking for a better fix.
(Reporter)

Updated

10 years ago
Flags: wanted1.9.1?

Updated

10 years ago
Component: Editor → Selection
QA Contact: editor → selection
Flags: wanted1.9.1? → wanted1.9.1+
You need to log in before you can comment on or make changes to this bug.