Closed Bug 269170 Opened 21 years ago Closed 20 years ago

a html select with Javascript added options and style:height set, grows when changing selected option

Categories

(Core :: Layout: Form Controls, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 292656

People

(Reporter: ipellaers, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 In the following HTML page a select box will grow. Things will be clear in the "Steps to Reproduce" step. ============================================== <html> <head> <title>Bugreport Javascript</title> <script type="text/javascript"> function populate(formIn, comboboxIn) { var option; if(comboboxIn.name == 'ComboBox1') { formIn.ComboBox2.options.length=0; formIn.ComboBox2.options[0] = new Option('Combobox21', 0); formIn.ComboBox2.options[1] = new Option('Combobox21 value 1', 1); } else if(comboboxIn.name == 'ComboBox2') { formIn.ComboBox1.options.length=0; formIn.ComboBox1.options[0] = new Option('Combobox12', 0); formIn.ComboBox1.options[1] = new Option('Combobox12 value 1', 1); } } </script> </head> <body> <form name='form1'> <table width='650'> <tr> <td> ComboBox1 </td> <td> <select style='height:20px' name='ComboBox1' onChange='javascript:populate(form1, this);'> <option value='0'>Combobox1 value 0</option> <option value='1'>Combobox1 value 1</option> </select> </td> </tr> <tr> <td> ComboBox2 </td> <td> <select style='height:20px' name='ComboBox2' onChange='javascript:populate(form1, this);'> <option value='0'>Combobox2 value 0</option> <option value='1'>Combobox2 value 1</option> </select> </td> </tr> </table> </form> </body> </html> Reproducible: Always Steps to Reproduce: Using the code submitted in the "details" section: 1. Select an other option in the first select box 2. Select an other option in the second select box 3. Now, each time you will change the selection in the second select box the box will grow in width. Actual Results: Using the code submitted in the "details" section: The second select box grows in width Expected Results: The box should've just stayed put, like it's supposed to. about:buildconfig Build platform target i686-pc-linux-gnu Build tools Compiler Version Compiler flags gcc gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -pthread -pipe c++ gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe -I/usr/X11R6/include Configure arguments --disable-ldap --disable-mailnews --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth --enable-crypto --disable-composer --enable-single-profile --disable-profilesharing --disable-debug '--enable-optimize=-Os -freorder-blocks -fno-reorder-functions -gstabs+' --disable-tests --enable-official-branding --enable-default-toolkit=gtk2 --enable-xft --disable-freetype2 --enable-static --disable-shared
I can reproduce this bug: I think this bug should be confirmed.
This should really be confirmed. I can reproduce it too.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050706 Firefox/1.0+ This bug can still be reproduced.
Flags: blocking-aviary1.1?
only changes size once here, which is slightly strange, but acceptable as a non-regression.
Assignee: firefox → nobody
Component: General → Layout: Form Controls
Flags: blocking-aviary1.1? → blocking-aviary1.1-
Product: Firefox → Core
QA Contact: general → layout.form-controls
Version: unspecified → Trunk
The key to the problem is in the CSS height parameter. If you remove the height setting, the select no longer changes width
Note that the growing width of the select is fixed by bug 292656, but the odd resizing that mconnor saw is just caused by the JS used. *** This bug has been marked as a duplicate of 292656 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Summary: a hmtl select with Javascript added options and style:height set, grows when changing selected option → a html select with Javascript added options and style:height set, grows when changing selected option
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: