Closed Bug 278195 Opened 20 years ago Closed 10 years ago

"Select" form control wont open when changed style in onFocus event.

Categories

(Core :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: deleteduser179836, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6) Gecko/20050111 Firefox/1.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6) Gecko/20050111 Firefox/1.0+

I have got a select control in a form on a webpage that handles onFocus and
onBlur events. On these event handlers, I change the className property of the
control to see if it's focused or not. What I expect is that the control changes
its styleclass and, also, expands to see all of it's contents. But it only
changes its style, and I have to click two more times over the control to open it.
It only happens the first time I try to open the control after the page has been
loaded. 
An example html page that reproduces the error is:


<html>
<head>
<style>
select.text
{
background-color:#EAEAFF;
color:#333333;
border:1px solid #939599;
font-weight:bold;
margin:2px;
margin-left:1px;
padding:1px;
width:100%;
}

select.textFocused
{
background-color:#FFFFFF;
color:#333333;
border:1px solid #939599;
font-weight:bold;
margin:2px;
margin-left:1px;
padding:1px;
width:100%;
}
</style>
<body>
<form>
<select name="foo" onFocus="this.className='textFocused'"
onBlur="this.className='text';" class="text">
<option> first</option>
<option>second</option>
</select>
</form>
</body>
</html>

Reproducible: Always

Steps to Reproduce:
1. Copy the example html page included in the description to a new .html file.
2. Open it with FireFox (from a Linux platform).
3. Click over the select control to open it. It will just change its color, but
no open unless you click over it again.
4. To see the error again, just reload the page and try again.

Actual Results:  
The select control changed its background color, but did not open.

Expected Results:  
The select control shound have changes its background color AND it should have
opened to see the different options available.
Attached file Testcase
A testcase to see the problem
I can confirm that this bug exists in Linux Firefox -- however, it seems to work
fine in Windows Firefox in my testing.
This seems to be related to other bugs which involve autocomplete.  If you add
autocomplete="off" to the select tag the problem goes away.  I did this as a
hunch after reviewing bug 236791.
(In reply to comment #1)
> This seems to be related to other bugs which involve autocomplete.  If you add
> autocomplete="off" to the select tag the problem goes away.  I did this as a
> hunch after reviewing bug 236791.

Could you please post an example?
I've been trying your solutions and I can't make it to work.

Thanks.
Assignee: bross2 → nobody
Product: Firefox → Core
QA Contact: general → general
The TC works fine now.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: