Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#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:
Blocked by: Blocking:

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 (9)

comment:1 Changed 8 years ago by dmethvin

Owner: set to camilo.arthur@…
Status: newpending

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.

comment:2 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

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:3 Changed 8 years ago by sindresorhus

#10973 is a duplicate of this ticket.

comment:4 Changed 8 years 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 7 years 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 7 years 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;
				}
			}	

comment:7 Changed 7 years ago by jstrimpel@…

This shouldn't bomb. As it did not break in previous versions of jQuery. I agree that trying to set focus to a disabled element is bad practice, but jQuery's response to this action shouldn't change between releases.

comment:8 Changed 7 years ago by anonymous

I just got the same error just visiting a page. Following the fact I have had multiple script errors for days, this is the first time I have seen this one

comment:9 Changed 5 years ago by anonymous

I am also getting the same error htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focu

i have two calender in two tabs when i move to second tab and open the calendar of second tab i am getting this error. please help.

Note: See TracTickets for help on using tickets.