Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#8083 closed bug (invalid)

IE select tag not firing change vent

Reported by: josepaulino@… Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

When you have a select tag with size > 1 Internet Explorer(I only could test with IE8) does not fire the change event when you change a selection by using the up/down arrows. Firefox and Chrome do.

There is a jsfiddle to show the behavior: http://jsfiddle.net/At8Ht/2

To reproduce:

  1. Click into the select box
  2. Press the up/down arrow

All browsers will fire the change event if you click an option. IE will not fire if you press the arrows.

My current workaround is to do this: $("#selector").bind('change keyup',function() {});

There's probably a better way :)

Change History (3)

comment:1 Changed 8 years ago by josepaulino@…

For some reason I mispelled event, please fix

comment:2 Changed 8 years ago by rjgotten

Change the select tag's selection using the up/down arrow keys and then tab away from the control or click outside it to make it lose focus. IE will fire the change event.

This is according to the conditions of the DOM Lvl 2 specification: "The change event occurs when a control loses the input focus and its value has been modified since gaining focus."

In DOM Lvl 3 the event has been dropped. Instead it is described in the HTML5 specification, where similar behaviour is defined: a change event should only be fired on an explicit commit action and as part of the unfocusing behaviour.

IE gets this right as well: try using the up/down keys to change the value and then press the enter key for the explicit commit action. IE will fire the change event correctly...

tl;dr: All the other browsers are getting this one wrong. IE gets it right.

comment:3 Changed 8 years ago by jitter

Component: unfiledevent
Priority: undecidedlow
Resolution: invalid
Status: newclosed

As detailed by rjgotten this works as expected. Fixing when the change event fires cross-browser isn't possible without adding an unjustifiable amount of code.

Note: See TracTickets for help on using tickets.