Ticket #10859 (closed bug: invalid)
Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
| Reported by: | camilo.arthur@… | Owned by: | camilo.arthur@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I'm getting the following error on IE 8.0:
Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; .NET4.0C; .NET4.0E) Timestamp: Tue, 22 Nov 2011 18:03:26 UTC
Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
The piece of code indicated by IE was:
jQuery.event.triggered = type; elem[type](); jQuery.event.triggered = undefined;
Change History
comment:1 Changed 18 months ago by dmethvin
- Owner set to camilo.arthur@…
- Status changed from new to pending
comment:2 Changed 18 months ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 18 months ago by anonymous
I also found this error in IE8. I have a very simple page which include JQuery in the <header> section. When trying to load the paeg, got a warning and nothing is displayed (empty page).
Error copied and shown below.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CMNTDF; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Thu, 15 Dec 2011 05:37:51 UTC
Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. Line: 4 Char: 3806 Code: 0 URI: http://localhost:65106/Scripts/jquery-1.7.1.min.js
comment:5 Changed 16 months ago by Mario Santos
I had the same issue on the latest jquery version (1.7.1, downloaded today!!) the solution was to put a try...catch statement around the condition. In my case, the problem was:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Mon, 30 Jan 2012 10:58:01 UTC Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. Line: 3175
And the lines affected: Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; elem[ type ]();
The code still haves a comment that points to a issue #1486 (4 years ago?) IE<9 dies on focus/blur to hidden element (#1486) http://bugs.jquery.com/ticket/1486
comment:6 Changed 15 months ago by anonymous
putting a try catch around the focus call worked for me.
if(retainFocus){
try {
this.newelement[0].focus();
} catch(err){
return false;
}
}
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.