Opened 16 years ago
Closed 16 years ago
#1569 closed bug (fixed)
create jQuery elemnent for <option> bug
Reported by: | LuckyKing | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | core | Version: | 1.1.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you create a jQuery element by $("<option>"), you will get an element like this: "<option selected />", which the attribute 'selected' will be set as default and cann't be changed.
$(document.createElement('<option>')) is ok.
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
I just thought of one possibility. The wrap could be changed to
wrap = [1, "<select multiple>", "</select>"];
so it won't force the only option to be selected. I'm not sure if there are any other side effects but it is one possible thing to look into if you really want to fix this bug.
comment:3 Changed 16 years ago by
Milestone: | 1.2 → 1.2.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Interesting. It appears that in FF2 at least (using firebug) the first option in the select is automatically selected. So in the code with
wrap = [1, "<select>", "</select>"];
you get
div.innerHTML = "<select><option></select>";
which creates the option that is selected. Putting wrap to
wrap = [1, "<select><option>", "</select>"];
would solve the problem on creation but the code isn't set up to unwrap it correctly which would require a special case. Just my observations in case they are useful. :)