Bug Tracker

Opened 15 years ago

Closed 15 years ago

#3223 closed bug (invalid)

Problems with select box append

Reported by: ipr101 Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:


I have created an html page (attached) that contains two list boxes. On selecting an element in the top list box and clicking the 'test' button an element is moved to the bottom listbox. The following code is then run to select the bottom option in the lower listbox -

document.getElementById('bSelect').options[document.getElementById('bSelect').options.length-1].selected = 'true';

In IE7 the element is not selected as requested, the code works as expected within Firefox.

Attachments (1)

lb.htm (3.6 KB) - added by ipr101 15 years ago.

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by ipr101

Attachment: lb.htm added

comment:1 Changed 15 years ago by ipr101

Sorry - the description is not clear. The last sentence should read -

In IE7 the element is selected as requested but the listbox does not scroll down to reveal the selected element. The code works as expected within Firefox.

comment:2 Changed 15 years ago by nathanhammon

I've reviewed your test case. The problem you're describing is a user-agent difference in how they adjust the scroll position of a <select> that has had an option element selected programmatically. It is successfully selecting the element in IE7 but by user-agent decision, it doesn't adjust which options are visible. This is not a jQuery bug, nor is it a bug in IE.

Ariel, this ticket can be closed as invalid.

comment:3 Changed 15 years ago by ipr101

Thanks for your feedback. If I remove the jquery append call from the javascript function, then IE will select the bottom selectbox element and scroll the select box position so the selected box is visible. This is what lead me to believe it was jquery bug, as IE's behaviour appaers to change after the jquery append call is made.

comment:4 Changed 15 years ago by john

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.