Bug Tracker

Ticket #10973 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

ie8: 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: anonymous Owned by:
Priority: low Milestone: None
Component: event Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

original ticket (10859) was closed by trac-o-bot.

comment was:

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;

commit:  https://github.com/jquery/jquery/commit/9aa553aa18e79989dfa002ae5a295f626951bdf5

Change History

comment:1 Changed 3 years ago by anonymous

I just upgraded from 1.6.2 to 1.7.1 and am seeing this on my existing code. Firefox and Chrome work fine; it's just IE (IE8 in my case).

comment:2 Changed 3 years ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to event

Add a jsfiddle testcase to the original ticket showing the issue, and I'll open it. Please refrain from opening duplicate issues.

comment:3 Changed 3 years ago by sindresorhus

Duplicate of #10859.

comment:4 Changed 3 years ago by jstrimpel@…

Any plans to fix this? I see that both associated bugs have been closed. I am going to through a painful $ and $.ui upgrade process and this is one of the pains. Wrapping every $.focus() statement in the code base in a try, catch is an unacceptable solution.

comment:5 follow-up: ↓ 6 Changed 3 years ago by dmethvin

Yes, the fix is to not set focus to an element that the user cannot see. Please don't comment in duplicate tickets.

comment:6 in reply to: ↑ 5 Changed 3 years ago by jstrimpel@…

I agree that is the correct procedure one should follow when coding. However, previous versions of jQuery allowed this or at the very least failed silently, which encouraged this bad practice. So now there is a code full of these errors, which needs to be patched because jQuery changed it's behavior/response to this bad coding practice.

Replying to dmethvin:

Yes, the fix is to not set focus to an element that the user cannot see. Please don't comment in duplicate tickets.

Note: See TracTickets for help on using tickets.