Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10314 closed Bug (invalid)

CKEditor in Dojo Dialog does not work

Reported by: Eric Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1
Keywords: Cc:

Description

When embedding the CKEditor into a Dojo (>= 1.8.2) Dialog with other widgets in the Dialog the CKEditor refuses to retain focus.

I have made a jsfiddle to reproduce the problem: http://jsfiddle.net/9MnqK/

The Dojo Editor (rich text editor) does not have this problem (and uses the same iframe trick that CKEditor uses.

Change History (4)

comment:1 Changed 11 years ago by Jakub Ś

Keywords: Dojo Dialog removed
Resolution: invalid
Status: newclosed

I don't think this is CKEditor issue.

  1. You can see it exactly in older and slower browser like CKEditor 3.6. When you click on editor focus is for a moment and then goes back to input filed. This isn't about editor refusing focus but rather about input filed taking it away (it has a lot of these focus attributes if you check code)
  2. If you remove input field there is no problem with focus in editor. Try it.
  3. Also in Firefox 20 -> for some reason input filed is not gaining focus there at the start. If you click in editor first you have focus but if you click then in input filed and next in editor focus will be stolen from editor.

I think you should rather check Dojo documentation for this. I’m closing this issue as I think it is invalid. @ EToreo if you don’t agree or have any other ideas why this is editor fault please write them and I will reopen this ticket.

comment:2 Changed 11 years ago by Eric

@j.swiderski I put alot of work into trying to figure out if this was a Dojo or CKEditor bug. I am very open to the idea that it is a Dojo bug - but what made me think it was a CKEditor bug is the fact that Dojo's own rich text editor (that uses an iFrame trick as well) does not have the focus problem. I looked for a long time in the Dojo source code for a reason their iFrame rich text editor would not have the problem and could not find any special case code.

Your thoughts?

comment:3 Changed 11 years ago by Jakub Ś

Hi,

I have two thoughts which I have already written:

  1. You can see it exactly in older and slower browser like CKEditor 3.6. When you click on editor focus is for a moment and then goes back to input filed. This isn't about editor refusing focus but rather about input filed taking it away (it has a lot of these focus attributes if you check code)
  2. If you remove input field there is no problem with focus in editor. Try it.

Please read especially point two and try it. If editor works without this input filed and doesn't whit it then IMHO Dojo is the one to blame. There is no code I know in editor that does something like "refuse focus".
If you look at the source of this input filed with e.g. Firebug you will notice a lot of Focus* or *Focused classes/attributes (like focusNode). I don't know what the relation between Dojo editor is and this input filed, what editor needs to have to gain focus. Perhaps you should look for these focus attributes/classes in dojo code - in what situations they are attached. Another thing to search for is blur event in dojo code.

I will just in case ask my colleagues if anything in editor may be doing this.

comment:4 Changed 11 years ago by Piotrek Koszuliński

This is similar issue to what we've seen with jQuery UI modals. Focus or typing was locked in dialogs and other places. I don't know why they did that, but as I understand, they need to block everything outside dialog contents. I guess that otherwise it was possible to move focus and caret outside of a dialog what is undesirable.

And this looks very similar in Dojo's case. Focus is blocked in the only input Dojo understands. You can open CKE's dialog and see this perfectly - try to focus one of inputs and caret will be immediately moved back to that input in Dojo's dialog.

Perhaps CKE's elements have to be registered to some kind of Dojo's focus manager. At least that was the right solution for jQuery UI.

See:

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy