Opened 12 years ago
Last modified 11 years ago
#10670 confirmed Bug
Inline CKeditor steals focus
Reported by: | Mandeep | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 Beta |
Keywords: | Webkit | Cc: |
Description
I have a div with inline ckeditor on it and also an input box. when the page loads, i assign the focus on the input box, but it seems that the ckeditor steals the focus. If the inline ckeditor is not present, the focus stays on the text box. How can I fix this?
here is the fiddle demonstrating the issue. http://jsfiddle.net/FLZhn/3/
P.S. I am using CKEditor version 4.0.2 and Chrome 28
Attachments (1)
Change History (6)
comment:1 Changed 12 years ago by
Keywords: | Webkit added |
---|---|
Status: | new → confirmed |
Version: | 4.0.2 → 4.0 Beta |
Changed 12 years ago by
Attachment: | inlineall2.html added |
---|
comment:2 Changed 12 years ago by
Though I was not able to reproduce it in Firefox 22, I was able to reproduce it in IE9. Can you also check on this? Thanks :)
comment:3 Changed 12 years ago by
Using code like document.getElementById("input_box").focus(); doesn't work because it is too fast to see. I debugged and found out that the CKEditor code takes around 250 - 300ms(results nay vary as I was running code on my localhost) to execute. So if I have a timeout of more than 300ms, I am putting focus after the code has executed.
Also, after CKEditor takes away the focus, and I minimize the window and open again, I can see the focus in the text box. I could not understand this behaviour but probably you could.
Hope this helps :)
comment:4 Changed 12 years ago by
I wasn't able to reproduce this problem i Firefox and IE when using attached sample. Seems only Webkit is affected.
I was able to reproduce this problem in Webkit browsers only from CKEditor 3.0.
Please see attached file.
Using code like
document.getElementById("input_box").focus();
doesn't work. When I use something likesetTimeout(function(){document.getElementById("input_box").focus();}, 500);
then it works.In my computer when I used in Chrome
setTimeout(function(){document.getElementById("input_box").focus();}, 200);
I could see input element gaining focus for a moment and then losing it. So the author is rather right that editor steals focus.