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

RESOLVED WORKSFORME

Status

()

Core
Layout: Form Controls
RESOLVED WORKSFORME
14 years ago
4 years ago

People

(Reporter: Paul Smith, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
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 http://www.pscs.co.uk/moztest2.php, 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...
<OPTION SELECTED>Last Line</OPTION>
</select>
</td></tr></table>

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 
visible.

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 
needed)
(Reporter)

Comment 1

14 years ago
Also see http://forums.mozillazine.org/viewtopic.php?t=103904
The problem seems to exist in versions of Mozilla as well as Firefox, but is 
reported to behave differently in different versions..

Updated

14 years ago
Keywords: testcase
(Reporter)

Updated

14 years ago
Component: General → Layout: Form Controls
Product: Firefox → Browser
Version: unspecified → 1.0 Branch

Comment 2

14 years ago
Not branch specific --> Trunk
Version: 1.0 Branch → Trunk
Whiteboard: DUPEME
(Reporter)

Comment 3

14 years ago
Created attachment 154079 [details]
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.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → WORKSFORME

Updated

4 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.