Opened 12 years ago
Closed 10 years ago
#9227 closed bug (wontfix)
Can't change the text of option tab cloned by jQuery's clone method(1.5&1.6,Only the select tag in IE6,7,8)
Reported by: | Owned by: | Rick Waldron | |
---|---|---|---|
Priority: | low | Milestone: | 1.9 |
Component: | manipulation | Version: | 1.5.2 |
Keywords: | ie7 | Cc: | |
Blocked by: | Blocking: |
Description
the html tags is as: <select>
<option value="good">good</option> <option value="good1">good1</option> <option value="good2">good2</option> <option value="good3">good3</option> <option value="good4">good4</option>
</select>
my codes is as:
var obj = $("select"); var temp = obj.clone(true); $("body").append(temp); $("option").each(function(){
$(this).text("dddd");
});
If you run it,you will watch, the original tag's text changed,bug the cloned option tags' texts can't change.
In IE8, with the Developer's tools,you can see, the text has changed, but users can't see the changed text, they only can see the old text;
Change History (19)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
There is another bug,. If you bind a change Event to the first select tag, after clone, the cloned tag's change Event will be trigger twice;
comment:3 Changed 12 years ago by
Component: | unfiled → manipulation |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsfiddle.net that reproduces the issue experienced to help us assess your ticket.
Additionally, test against the jQuery (edge) version to ensure the issue still exists.
comment:4 Changed 12 years ago by
Status: | pending → new |
---|
The text case url is http://jsfiddle.net/LT5aE/1/ (Only IE 6,7,8 has this bug, I don't know whether IE9 has;)
comment:5 Changed 12 years ago by
Owner: | changed from [email protected]… to Rick Waldron |
---|---|
Status: | new → assigned |
comment:6 follow-up: 7 Changed 12 years ago by
Priority: | low → high |
---|
comment:10 Changed 12 years ago by
Reduction with clearer details: http://jsfiddle.net/rwaldron/UgV89/
comment:12 Changed 12 years ago by
I'm sorry, the problem is still there, and your test case also! Please run it in IE, and you can see the problem!
comment:13 Changed 11 years ago by
from your log that'is right,but please watch the page.Yes, the text is changed, I can watch the changed text by debug tools, but user can't see the changed text,they can only see the original text!
comment:15 Changed 11 years ago by
Because of IE's bug,so jQuery has this bug.But,in version 1.4.2, the method is very well, why you don't use it?
comment:16 Changed 11 years ago by
Keywords: | ie7 added |
---|---|
Priority: | high → low |
Assigning to the option.text
property is the only thing that seems to work, not even innerText
updates it. (Remember new Option(text, value)
for creating option elements?) This would need to be hard wired into jQuery.fn.text I suppose?
comment:17 Changed 11 years ago by
comment:18 Changed 10 years ago by
Milestone: | 1.next → 1.9 |
---|
comment:19 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
We decided not to attempt shimming jQuery.text
for these cases for performance and size issues. The workaround mentioned above works across all browsers if you need it. http://jsfiddle.net/UgV89/14/
sorry,the codes is not right. The real codes is var obj = $("select"); var temp = obj.clone(true); $("body").append(temp); $("select").each(function(){
}); Then, you can't change the Text!