Closed Bug 252624 Opened 17 years ago Closed 15 years ago

multiline SELECT with width style defined, in table cell doesn't make the selected item visible


(Core :: Layout: Form Controls, defect)

Windows XP
Not set





(Reporter: paul, Unassigned)




(Keywords: testcase)


(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.52  [en]
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2

If you put a multi-line SELECT element with a "STYLE='width:100%'" into a table 
cell, and have a pre-selected item in the SELECT list, the SELECT list will 
always show the top x lines of the SELECT list, even if that means that the pre-
selected item isn't visible.

(If the same SELECT element isn't in a table, or doesn't have the 'width' style, 
then it seems to work OK)

In the page at, the last line in each list 
should be selected and visible. In the first list, it is selected, but not 
visible. The other lists work OK.

Reproducible: Always
Steps to Reproduce:
<table width="100%"><tr><td>
<select size="10" style="width:100%;">
..long list of options...

Actual Results:  
The last line is selected, but not visible

Expected Results:  
The last line should have been selected and the listbox scrolled until it was 

A workaround is to select the last line after the page has loaded (in the onLoad 
event of the page). You have to make sure the last line isn't already selected 
though, eg

function Loaded()
var x = document.myform.mylist.selectedIndex;
document.myform.mylist.selectedIndex = 0;
document.myform.mylist.selectedIndex = x;

(this shouldn't cause problems on other browsers either, but it shouldn't be 
Also see
The problem seems to exist in versions of Mozilla as well as Firefox, but is 
reported to behave differently in different versions..
Keywords: testcase
Component: General → Layout: Form Controls
Product: Firefox → Browser
Version: unspecified → 1.0 Branch
Not branch specific --> Trunk
Version: 1.0 Branch → Trunk
Whiteboard: DUPEME
Attached file Test case
Copy of the web page test case for future reference
Assignee: firefox → nobody
QA Contact: general → layout.form-controls
Fixed somewhere along the line, apparently: the testcase works for me in current trunk and branch builds.
Closed: 15 years ago
Resolution: --- → WORKSFORME
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.