Bug Tracker

Opened 8 years ago

Closed 8 years ago

#13934 closed bug (notabug)

Dialog - "autofocus" attribute do not work in IE sometimes

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

I tested this bug is found at least found in IE8-9 The jQuery ui version tested is 1.10.3

If user edit a textfield A, and then click textfield B immediately, at the same time, the onchange event of A open a dialog for data verification purpose.

The focus will remain in textfield A, which is very bad behaviour for data verification dialog

jsbin and jsfiddle do not work with IE8, so i post my code here

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
function showdialog(){
$( "#dialog" ).dialog();

	//workaround
	setTimeout(
    			function(){
	    			document.activeElement.blur();
	    			testinput.focus();
	    		}
    		,10000);	//10s timeout

}
</script>
</head>
<body>
<div id="dialog" style="display:none">
The autofocus do not work in IE
(workaround will focus it after 10s)
<br/>
<input id=testinput autofocus />
</div>
Type a few letter in this textarea and click another textarea immediately.<input onchange="showdialog();" />
<br/>
<br/>
<br/>
<input >
</body>
</html>

Change History (3)

comment:1 Changed 8 years ago by anonymous

There is no version "1.10.3" for selection when create ticket, please change to 1.10.3

comment:2 Changed 8 years ago by anonymous

The test code will not function in jsbin and jsFiddle for IE at all.

The test code must be saved as a html file and then open by IE

http://jsbin.com/eqomuq/1/edit

comment:3 Changed 8 years ago by dmethvin

Resolution: notabug
Status: newclosed

This is the jQuery core bug tracker. You may want the UI bug tracker but perhaps should ask for help on a forum first. http://bugs.jqueryui.com

Note: See TracTickets for help on using tickets.