#10943 closed bug (fixed)
JQuery 1.7.1 does not properly set tabindex property on cloned element in IE7
Reported by: | Owned by: | mikesherov | |
---|---|---|---|
Priority: | low | Milestone: | 1.8.3 |
Component: | attributes | Version: | 1.7.1 |
Keywords: | ie7 clone | Cc: | |
Blocked by: | Blocking: |
Description
JQuery 1.7.1 does not properly set tabindex property on cloned element in IE7. This works in both Firefox and Chrome. It also works in IE7 when using jQuery 1.6.2.
Steps To Reproduce: Click each button in order from left to right, noting the tab order after each click.
<html> <head> <!-- <script type="text/javascript" src="jquery-1.6.2.min.js"></script> --> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> var indexOrder = new Array(1, 3, 5, 2, 4); $(function() { $("#crazyTabIndexButton").click(function(event) { event.preventDefault(); setCrazyTabIndexes($(this).parents("form")); }); $("#cloneButton").click(function(event) { event.preventDefault(); var clone = $("form").filter(":first").clone(); $("#formContainer").append(clone); }); $("#resetUsingJqueryButton").click(function(event) { event.preventDefault(); resetTabIndexesUsingJquery(); }); $("#resetUsingJavascriptButton").click(function(event) { event.preventDefault(); resetTabIndexesUsingJs(); }); }); function setCrazyTabIndexes() { $("form :input").each(function(index, input) { $(input).prop("tabindex", indexOrder[index]); }); } function resetTabIndexesUsingJquery() { var newIndex = 0; $("form :input").each(function(index, input) { $(input).prop("tabindex", ++newIndex); }); } function resetTabIndexesUsingJs() { var newIndex = 0; $("form :input").each(function(index, input) { input.setAttribute("tabIndex", ++newIndex); }); } </script> </head> <body> <h3>JQuery 1.7.1 does not properly set tabindex property on cloned element in IE7</h3> Steps To Reproduce: Click each button in order from left to right, noting the tab order after each click. <br/><br/> <button id="crazyTabIndexButton">Set Crazy Tab Indexes</button> <button id="cloneButton">Clone Form</button> <button id="resetUsingJqueryButton">Reset Tab Indexes using JQuery</button> <button id="resetUsingJavascriptButton">Reset Tab Indexes Using Plain JS</button> <div id="formContainer"> <form> <div>0: <input type="text" /></div> <div>1: <input type="text" /></div> <div>2: <input type="text" /></div> <div>3: <input type="text" /></div> <div>4: <input type="text" /></div> </form> </div> </body> </html>
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Status: | new → open |
jQuery successfully clones the elements tabIndex, but is not able to set the "tabindex" on the cloned elements in IE7.
This problem is only apparent in the real IE7, not IETester or IE7 mode in IE8/9.
comment:3 Changed 11 years ago by
Keywords: | ie7 clone added |
---|
comment:4 Changed 10 years ago by
Milestone: | None → 1.8 |
---|---|
Owner: | set to mikesherov |
Status: | open → assigned |
This was inadvertently fixed by https://github.com/jquery/jquery/commit/3e2a77c5e882b5fc88bf5469ea00067833a2a059 in 1.8.
timmywil, do we need a unit test for this? If so, I'll write one. Otherwise, I can close.
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #10943, tabindex not set properly on clone in IE7. Close gh-937.
This is only a unit test fix because the bug was tangentially fixed by a different commit
Changeset: f9ef91d6d68dc7317bb12c1ae2a8201f28facff1
comment:8 Changed 10 years ago by
Milestone: | 1.8 → 1.8.3 |
---|
http://jsfiddle.net/VauK7/