On IE 7, I'm finding that CKEditor grabs the initial focus on a node add/edit form in the last textbox field that appears on the form. If the node only has one textbox field (body) then focus is in the only textbox field on the form.

My understanding, I believe the default behavior for most browsers is to not set any initial focus on any of the input fields on the form. Depending on the browser, initial focus is typically on the browser address bar, and you have to set initial focus on one of the form's input fields with a mouse click, or tab in.

Behavior seems correct on Firefox and Safari (CKEditior does not grab initial focus). I'm just seeing the problem on IE (have only tested IE 7).

Probably wouldn't be so bad, accept CKEditor seems to grab the focus on the last textbox field on the form, not the first (I have some custom node types that have multiple textbox fields). This is pretty distracting when you bring up a node add/edit form, and the initial focus causes you to land way down the page.

I did try setting config.startupFocus = false; in ckeditor.config.js (although I think default is false). Didn't seem to make any difference for IE.

Seems like this may be a similar to an startup focus problem in IE reported some time ago ...

http://cksource.com/forums/viewtopic.php?f=5&t=8080

http://dev.fckeditor.net/ticket/2274

Comments

wxman’s picture

I've been wondering if you ever found a solution to this? The only fix I had was to set the form on a separate page.

corridor’s picture

No, haven't found the answer. I was hoping to at least see some validation that other's are seeing the same thing? Sounds like you have?

I really wouldn't want to go to a multi-page form to get around this.

wxman’s picture

It's happening here too. I've tried it in all the browsers, and as different roles, and it always grabs the focus on IE7. I don't have IE8 so I can't try that one. I don't want to go multi page either. I'm trying the Talk module, but I'm having a bit of trouble getting it to work with my theme. If it works, that might solve most of my problems.

wwalc’s picture

I didn't try to reproduce it yet, but before I start digging further - can you please check whether it has something to do with the following code in CKEditor module:

// IE8 - initial focus problem
if (CKEDITOR.env.ie)
  ev.editor.insertHtml('');

(includes/ckeditor.utils.js)

it was an ugly hack and I'm not sure if it's actually still needed, please try removing it, clear drupal/browser cache and see if that changed anything.

corridor’s picture

Bravo, that got it! Fixed it for me. I tested on both IE7 and IE8.

wxman’s picture

That kind of works for me too, thanks.

The only thing that's still not right is after the page opens, if I click into the editor, the whole page shifts down. The editor is now at the top of the browser, and the rest of the page is above it out of reach. It still works because if I enter something and save it, the page goes back to normal.

wwalc’s picture

Status: Active » Fixed

Setting as fixed because the original issue has been fixed.

@wxman - for me it looks like a problem with another module. Please feel free to create a separate issue dedicated to this problem. Make sure that you have tried disabling other modules other than CKEditor to see if that's not a source of problem. It it is a conflict with other module, please let me know.

wxman’s picture

@wwalc - Just to let you know, that after testing, my strange page position problem must be something else, not this module. I've disabled many to test, including the ckeditor one, and it's still doing it. Must be something in my theme doing it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.