Ticket #5869 (closed bug: fixed)
SELECT element change event firing on focus first time in IE
| Reported by: | nberardi | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4.1 |
| Component: | event | Version: | 1.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This bug is very easy to reproduce. I have personally verified it exists in IE 7 and 8.
I have this simple select:
<select name="zlecenia_index_icpp" id="items_per_page">
<option value="10">10</option>
<option value="25" selected="selected">25</option>
<option value="50">50</option>
</select>
and the following code is used for the change event:
$('#items_per_page').change(function(){
var controller_action = this.name.replace(/_/g, '/');
location.href = config.base_url + '/' + controller_action + '/'+this.value;
});
This code used to work in jQuery 1.3, but in 1.4 the change event is fired as soon as I click on the select box. This only happens one time and then functions normally.
I can't verify the actual problem but it works alot like this code:
$('#items_per_page').one("focus", function() { ... });
Here is where it was originally reported, or at least where I saw a confirmation that others were experiencing my same issue.
http://stackoverflow.com/questions/2093121/jquery-1-4-change-event-bug-in-ie
Change History
comment:2 Changed 3 years ago by mcurry
- Status changed from closed to reopened
- Resolution fixed deleted
Still broke. Same test case above. Setting one of the options as selected is important. Fix here: http://github.com/mcurry/jquery/commit/a293f5938eb9efd41158b948f487672d43b7c820
comment:3 Changed 3 years ago by john
- Priority changed from critical to major
- Status changed from reopened to closed
- Resolution set to fixed
Landed w/ test case. http://github.com/jquery/jquery/commit/f6ec9d54d11432b91577addab6e613fb1f7a5203
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Should be fixed by this commit for 1.4.1:
http://github.com/jquery/jquery/commit/435772e29b4ac4ccfdefbc4045d43f714e153381