Open Bug 646871 Opened 13 years ago Updated 4 months ago

Within a content editable block and the next block is not editable, down key selects parent, instead of next editable block.

Categories

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

x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: sam, Unassigned)

References

(Blocks 1 open bug, )

Details

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Firefox 4.0

If you have a content editable block, and the next block after your cursor is editable false, pressing the down key will select the parent, instead of the next editable block.

Reproducible: Always

Steps to Reproduce:
1. Put your cursor on the 'some text' p
2. Press down arrow key.
Actual Results:  
Parent div is selected.

Expected Results:  
'some other text' should be selected.
Component: General → Editor
QA Contact: general → editor
Hmm, I'm not sure what you mean by parent div being selected in comment 0.  We don't show a caret on the non-editable div, and that's the expected behavior.
I've done another revision to illustrate the problem with a border: http://jsbin.com/itari3/2

IMO, the cursor shouldn't vanish when going over non editable divs, and instead just skip to the next editable block. However, at the very least, the non-editable div should return as the focusNode.
(In reply to comment #2)
> I've done another revision to illustrate the problem with a border:
> http://jsbin.com/itari3/2
> 
> IMO, the cursor shouldn't vanish when going over non editable divs, and instead
> just skip to the next editable block. However, at the very least, the
> non-editable div should return as the focusNode.

Yes, that behavior is not perfect, and can definitely be improved.
My specific use case is that I'm writing an editor that format blocks as P if the selection falls on the root element, so currently I'm creating an empty P each time you arrow down against a non editable block, and it's impossible to get below the non editable block with the arrow keys.

I'll probably end up manually moving the selection to the next editable block, if I notice that is what happened. Kind of a bummer.

Thanks for looking!
(In reply to comment #4)
> I'll probably end up manually moving the selection to the next editable block,
> if I notice that is what happened. Kind of a bummer.

Unfortunately I think your best bet for now would be to work around this bug, since fixing it in Firefox is not trivial, and it will probably take some time before I can get back to this...  Sorry.  :(

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.