Last Comment Bug 126379 - Select (size=1) onChange not called using down arrow key
: Select (size=1) onChange not called using down arrow key
Status: NEW
: access, helpwanted
Product: Core
Classification: Components
Component: Keyboard: Navigation (show other bugs)
: Trunk
: x86 All
: -- normal with 37 votes (vote)
: ---
Assigned To: Mats Palmgren (:mats)
:
: Andrew Overholt [:overholt]
Mentors:
http://www.dynamicdrive.com/dynamicin...
: 130298 137055 154877 158551 161551 166829 169867 177580 178288 189973 193994 194403 198510 199881 216556 225699 229424 230652 231712 234893 242901 254573 256157 261526 265389 268203 272571 274388 280659 285145 288187 288300 290590 296125 303890 308008 353968 380384 508242 807948 969068 (view as bug list)
Depends on: 312094 312162
Blocks: 553417
  Show dependency treegraph
 
Reported: 2002-02-19 01:57 PST by Mathias Bogaert
Modified: 2016-07-24 04:02 PDT (History)
75 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Javascript workaround example (1.39 KB, text/html)
2006-08-24 03:32 PDT, Simon Wunderlin
no flags Details

Description Mathias Bogaert 2002-02-19 01:57:51 PST
When you change the selected item with the mouse, the text changes (the JS is
called).

When pressing key down and up (looping though the select box), this onChange is
not called.

Build ID 2002021708, works in IE
Comment 1 Aaron Leventhal 2002-02-19 02:23:23 PST
Chris, do you know who should own this?
Comment 2 Olav Vitters 2002-02-19 02:44:20 PST
See bug 110800, wontfix?
Comment 3 David Emmerson 2002-02-19 05:47:15 PST
The script on the page at the URL above does work. Select an item, tab to move the
focus to the button and the text changes.

http://www.w3.org/TR/html401/interact/scripts.html#adef-onchange -- <q>The
onchange event occurs when a control loses the input focus and its value has
been modified since gaining focus.</q>

Definately should be wontfix.
Comment 4 Olav Vitters 2002-02-19 07:50:31 PST
wontfix it is
Comment 5 Jesse Ruderman 2002-06-28 16:49:31 PDT
*** Bug 154877 has been marked as a duplicate of this bug. ***
Comment 6 Jesse Ruderman 2002-06-28 16:54:50 PDT
*** Bug 137055 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Ruderman 2002-06-28 17:02:46 PDT
*** Bug 130298 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Ruderman 2002-08-07 14:05:09 PDT
*** Bug 158551 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Ruderman 2002-08-07 14:06:33 PDT
*** Bug 161551 has been marked as a duplicate of this bug. ***
Comment 10 Boris Zbarsky [:bz] (still a bit busy) 2002-09-06 04:03:07 PDT
*** Bug 166829 has been marked as a duplicate of this bug. ***
Comment 11 sairuh (rarely reading bugmail) 2002-09-17 13:53:24 PDT
mass-verifying Wontfix bugs.

mail filter string for bugspam: Tursiopstruncatus
Comment 12 Malcolm Rowe 2002-09-20 03:32:21 PDT
*** Bug 169867 has been marked as a duplicate of this bug. ***
Comment 13 Jesse Ruderman 2002-11-11 15:27:29 PST
*** Bug 178288 has been marked as a duplicate of this bug. ***
Comment 14 Jesse Ruderman 2002-11-11 15:27:31 PST
*** Bug 177580 has been marked as a duplicate of this bug. ***
Comment 15 Ruslan Ismailov 2003-01-21 13:03:12 PST
*** Bug 189973 has been marked as a duplicate of this bug. ***
Comment 16 Alfonso Martinez 2003-02-19 02:01:10 PST
*** Bug 193994 has been marked as a duplicate of this bug. ***
Comment 17 Alfonso Martinez 2003-02-21 12:57:11 PST
*** Bug 194403 has been marked as a duplicate of this bug. ***
Comment 18 Boris Zbarsky [:bz] (still a bit busy) 2003-03-20 17:33:59 PST
*** Bug 198510 has been marked as a duplicate of this bug. ***
Comment 19 Josh Birnbaum 2003-03-30 12:55:01 PST
*** Bug 199881 has been marked as a duplicate of this bug. ***
Comment 20 Jesse Ruderman 2003-08-18 19:01:08 PDT
*** Bug 216556 has been marked as a duplicate of this bug. ***
Comment 21 Alfonso Martinez 2003-11-25 15:18:39 PST
*** Bug 225699 has been marked as a duplicate of this bug. ***
Comment 22 Boris Zbarsky [:bz] (still a bit busy) 2004-01-11 16:58:22 PST
*** Bug 229424 has been marked as a duplicate of this bug. ***
Comment 23 Boris Zbarsky [:bz] (still a bit busy) 2004-01-11 17:00:53 PST
*** Bug 230652 has been marked as a duplicate of this bug. ***
Comment 24 Graham Lea 2004-01-11 18:11:04 PST
Two comments:

Firstly, there is a problem here with consistency. This bug has been marked
"wontfix" because the w3c recommendation says the onChange event should only
happen when the control loses focus. However, if I change the SELECT with my
mouse, it doesn't lose focus, but I still get the event, which is inconsistent
with the currently displayed behaviour with the keyboard.

Secondly, might I be so bold as to suggest that the w3c recommendation is WRONG
on this one? It is only a recommendation, they are not infallible, and the sheer
number of duplicates for this bug shows that the behaviour of this component is
_not_ intuitive. Have there been any bugs complaining that changing a SELECT
with a mouse produces an onChange event even though the control still has focus,
and that this is inconsistent with the w3c recommendation? No. Because it makes
sense that when a SELECT is changed, an onChange event is fired, regardless of
any focus issues.

At any rate, may I petition that you please don't leave this control with its
current incosistent behaviour.
Comment 25 Boris Zbarsky [:bz] (still a bit busy) 2004-01-21 08:23:43 PST
*** Bug 231712 has been marked as a duplicate of this bug. ***
Comment 26 Alfonso Martinez 2004-02-07 06:03:14 PST
*** Bug 198510 has been marked as a duplicate of this bug. ***
Comment 27 José Jeria 2004-02-19 15:01:32 PST
*** Bug 234893 has been marked as a duplicate of this bug. ***
Comment 28 Matthew Burgess 2004-04-05 07:57:34 PDT
As well as the difference pointed out in behaviour between selecting a value
with the mouse (wrong according to W3C's spec) and with the keyboard (correct as
per the W3C's spec), the behaviour of the onchange event of radio buttons is
also inconsistent.  With radio buttons the onchange event fires *before* focus
is lost.  If you've marked this as WONTFIX, and are sticking by this, then the
following list may be of use so as the inconsistencies in conformance to the
standard can be ironed out:

Input Control     onchange conforms to HTML 4.01 spec
------------------------------------------------------
select            Yes (when using keyboard to select value)
select            No (when using mouse to select value)
radio             No
checkbox          No
textarea          Yes
text              Yes
password          Yes

In all the non-conformant cases, the event is fired before the element loses focus.

Personally, I agree with comment #24 and think that the W3C got things wrong
with the onchange event description.  They already define an onblur event if
someone wants to take the focus of an element into account!
Comment 29 Boris Zbarsky [:bz] (still a bit busy) 2004-05-06 23:47:01 PDT
*** Bug 242901 has been marked as a duplicate of this bug. ***
Comment 30 José Jeria 2004-08-06 07:05:07 PDT
*** Bug 254573 has been marked as a duplicate of this bug. ***
Comment 31 José Jeria 2004-08-19 08:54:14 PDT
*** Bug 256157 has been marked as a duplicate of this bug. ***
Comment 32 Nicholas 2004-08-19 09:06:41 PDT
(In reply to comment #28)

I agree with this poster; the behaviors seem to inconsistent in regards to
onChange and onBlur. In this case, I believe Internet Explorer got it right,
triggering the onChange even when being changed with a keyboard device.
Comment 33 Nicholas 2004-08-19 09:24:44 PDT
I want to add that this behavior confuses certain designs that worked fine in
Internet Explorer; for example, you have a SELECT with an onchange event
attached to it which updates a text box with the currently selected value:

<SELECT id="mySelect" onchange="document.getElementById('outputValue').value =
document.getElementById('mySelect').value;">
<OPTION value="Test1">Test1</OPTION>
<OPTION value="Test2">Test2</OPTION>
</SELECT>

<INPUT type="text" id="outputValue"></INPUT>

In Internet Explorer, this works as I would expect it to, updating the textbox
after each change of the SELECT's item. In FireFox, it changes after you tab
away/blur from the control. Isn't that what the onBlur event is for?

Another good example of confusion is SELECT's that are driven from the selection
of another SELECT:

<SCRIPT type="text/javascript">
function mySelect_changed() {
	// clear out the SELECT
	for (var i = document.getElementById('childSelect').length - 1;i > -1;i--)
		document.getElementById('childSelect').options[i] = null;			
	if (document.getElementById('mySelect').value == 'Test1') {
	
document.getElementById('childSelect').options[document.getElementById('childSelect').length]
= new Option('Test1a','Test1a',false,false);
	
document.getElementById('childSelect').options[document.getElementById('childSelect').length]
= new Option('Test1b','Test1b',false,false);
	}
	if (document.getElementById('mySelect').value == 'Test2') {
	
document.getElementById('childSelect').options[document.getElementById('childSelect').length]
= new Option('Test2a','Test1a',false,false);
	
document.getElementById('childSelect').options[document.getElementById('childSelect').length]
= new Option('Test2b','Test1b',false,false);
	}	
}
</SCRIPT>

<SELECT id="mySelect" onchange="mySelect_changed()">
<OPTION value="Test1">Test1</OPTION>
<OPTION value="Test2">Test2</OPTION>
</SELECT>

<SELECT id="childSelect">
</SELECT>
Comment 34 Simon Wunderlin 2004-08-19 11:17:02 PDT
(In reply to comment #33)
this is exactly what many web developers expect to happen. why should an
onchange be triggered onBlur but only if one uses the keyboard but not the mouse ?
Comment 35 timeless 2004-08-19 14:52:22 PDT
most pages i see do onchange="window.location=..." which causes the keyboard
navigation to get hosed. this is wontfix and should remain so.
Comment 36 Nicholas 2004-08-19 15:01:18 PDT
(In reply to comment #35)
> most pages i see do onchange="window.location=..." which causes the keyboard
> navigation to get hosed. this is wontfix and should remain so.

A SELECT element with an instant location navigation via onchange has always
been a poor design choice. There are plenty of better reasons to use an onchange
behavior more consistant to what IE has been doing all along, such as the
examples I gave above.

This shouldn't be marked "WONTFIX" -- look at Comment #28 for a chart detailing
how inconsistent Firefox/etc. is at handling the onchange event.
Comment 37 Tommy Morgan 2004-08-19 16:28:50 PDT
(In reply to comment #36)
> 
> A SELECT element with an instant location navigation via onchange has always
> been a poor design choice.
[snip]
> 
> This shouldn't be marked "WONTFIX" -- look at Comment #28 for a chart detailing
> how inconsistent Firefox/etc. is at handling the onchange event.

I with agree that the current behavior in Mozilla is funky and should be changed
to the way other browsers behave.  I have heard the argument about redirection
before.  Redirecting on an onchange is usually a bad idea.  So, Mozilla contains
a serious functionality change basically to make a poor design less annoying?

I also agree that the W3C missed the mark on this one.  From all the traffic I
have seen regarding this bug and it's dupes, it seems that the vast majority of
users don't like the behavior as it is and all we usually get is a blunt
"wontfix" from the Mozilla developers (usually with a mention of the W3C
recommendation or the redirection example).  It kind of feels like we're being
ignored.
Comment 38 Boris Zbarsky [:bz] (still a bit busy) 2004-09-29 14:03:01 PDT
*** Bug 261526 has been marked as a duplicate of this bug. ***
Comment 39 Graham Lea 2004-09-29 16:36:47 PDT
Can it be THAT HARD to change this!?

It seems pretty clear that anyone who writes JavaScript and uses a keyboard to
fill in forms thinks Mozilla is doing the wrong thing here.
Yes - WRONG. It is both unintuitive and inconsistent with other browsers'
behaviour - that makes it wrong; regardless of what any recommendation says.

Why has this not been addressed in two and a half years?
When over 20 people have filed it as a bug and people continue to bring it up
and comment on it, how can you continue to believe that anyone's content with
the current behaviour?
Is the customer not important?
Or does "WONTFIX" == "CANTBEBOTHERED"?

Please change it.
Comment 40 Jesse Ruderman 2004-10-21 16:57:31 PDT
*** Bug 265389 has been marked as a duplicate of this bug. ***
Comment 41 Boris Zbarsky [:bz] (still a bit busy) 2004-11-15 01:02:35 PST
*** Bug 268203 has been marked as a duplicate of this bug. ***
Comment 42 PikeUK 2004-12-01 03:48:25 PST
*** Bug 272571 has been marked as a duplicate of this bug. ***
Comment 43 Simon Wunderlin 2004-12-01 07:27:43 PST
I know this bug is still a WONTFIX, however i might have a work arround for all
those ppl having problems with Mozilla's behavour with the onchange on select
form fields.

I have just discovered, that the onchange is triggered when the keyboard
navigation is used, but only if the size attribute of the selectbox is > 1

Example (won't trigger onchange before the select looses focus):
<select onchange="alert(this.selectedIndex);">
  <option value="0">zero</option>
  <option value="1">one</option>
  <option value="2">two</option>
</select>


However, this will trigger the onchange event when the keyboard is used (this is
tested with FF 1.0/Suite 1.7.3 on W2K:
<select onchange="alert(this.selectedIndex);" size="3">
  <option value="0">zero</option>
  <option value="1">one</option>
  <option value="2">two</option>
</select>

Whoever is responsible for this bug. _please_ reconsider the WONTFIX flag.
Whatever if W3C got this wrong or the implementation is wrong doesn't matter.
the behavour is inconsistent (see comment #28), it does not behave as web
developer would expect it, it does not comply with all the implementations of
other browser (hence, even NN4 did trigger an onchange when the keyboard was used).

In fact, the onchange is only called onblur when a user uses the keyboard to
navigate trough a selectbox with size 1. In all other cases (mouse, or size >1)
the onchange is actually triggered on-change instead of onblur.
Comment 44 Gary van der Merwe 2004-12-13 10:20:06 PST
*** Bug 274388 has been marked as a duplicate of this bug. ***
Comment 45 Erik Fabert 2005-02-01 08:14:36 PST
*** Bug 280659 has been marked as a duplicate of this bug. ***
Comment 46 José Jeria 2005-03-07 09:42:16 PST
*** Bug 285145 has been marked as a duplicate of this bug. ***
Comment 47 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-29 12:29:00 PST
*** Bug 288187 has been marked as a duplicate of this bug. ***
Comment 48 José Jeria 2005-03-30 07:53:36 PST
*** Bug 288300 has been marked as a duplicate of this bug. ***
Comment 49 Kevin Brosnan 2005-05-31 16:11:37 PDT
*** Bug 296125 has been marked as a duplicate of this bug. ***
Comment 50 Aaron Leventhal 2005-06-20 09:35:38 PDT
*** Bug 297310 has been marked as a duplicate of this bug. ***
Comment 51 David Baron :dbaron: ⌚️UTC-10 2005-08-01 23:00:27 PDT
*** Bug 290590 has been marked as a duplicate of this bug. ***
Comment 52 Peter van der Woude [:Peter6] 2005-09-11 09:17:50 PDT
*** Bug 308008 has been marked as a duplicate of this bug. ***
Comment 53 Jesse Ruderman 2005-09-12 19:06:34 PDT
*** Bug 308008 has been marked as a duplicate of this bug. ***
Comment 54 Jesse Ruderman 2005-09-12 19:20:09 PDT
I think we should revisit this decision because:

* This makes Firefox less compatible with other browsers.

* Navigation dropdowns, which were the reason for the change in bug 110800, are
becoming less common, while using JavaScript to update forms is becoming more
common.

* Some navigation dropdowns work better when onchange fires right away for
keyboard selection: http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm.

* Sites that use DHTML to update forms are less keyboard-accessible because of
Firefox's current behavior.

* Keyboard-bound users do have a way to work around sites that use dropdowns for
navigation, even if it isn't very discoverable.

* This bug is getting a lot of dups.

Since I'm the reporter of bug 110800, I'm taking the liberty of reopening this bug.
Comment 55 Jesse Ruderman 2005-09-12 19:23:27 PDT
cc hixie, who is re-standardizing onchange and standardizing oninput in
http://whatwg.org/specs/web-forms/current-work/.
Comment 56 Boris Zbarsky [:bz] (still a bit busy) 2005-09-12 19:28:53 PDT
> * Keyboard-bound users do have a way to work around sites that use dropdowns
> for navigation, even if it isn't very discoverable.

They can also, more discoverably, work around sites that use this sort of thing
for DHTML...

Note that I've observed no decrease in the frequency of navigation dropdowns.
Comment 57 Jesse Ruderman 2005-09-12 19:36:31 PDT
One possible solution, which I think would be the most solution most consistent
with http://whatwg.org/specs/web-forms/current-work/#the-change, would be to add
support for <select oninput>, evangelize sites that use DHTML for forms to use
oninput in addition to onchange, and re-WONTFIX this bug.
Comment 58 Boris Zbarsky [:bz] (still a bit busy) 2005-09-12 19:55:28 PDT
I'd be happy to do that, I think.
Comment 59 Hixie (not reading bugmail) 2005-09-13 19:48:58 PDT
If the user drops the drop-down and selects an option then rolls it back up (all
using the keyboard) then onchange should fire when the drop-down is rolled back
up. However, we can't do that if the user is just typing into the select or
using up and down without the drop-down since we have no way to determine when
the selection finished in that scenario.

The above paragraph is intended to be consistent with what the WHATWG spec says.

HTH.
Comment 60 Graham Lea 2005-09-13 20:18:56 PDT
In repsonse to the previous comment, I think the event is very 
clearly 'onChange', as opposed to 'onEndOfSelection', if you get my drift.
As a programmer, I would expect an onChange event to be fired every time the 
value of the input is changed, regardless of whether the user is still moving 
through or typing or whatever.
If I wanted to only perform my specific action when I'm sure the user has 
stopped changing the value, I'd take responsibility for that by setting a timer 
for about a second to execute my action and cancelling it if the value changes 
in that time.
Comment 61 Boris Zbarsky [:bz] (still a bit busy) 2005-09-13 20:28:22 PDT
> since we have no way to determine when the selection finished in that scenario.

When the control is blurred or the user hits enter.  That's when we fire
onChange now.

> every time the value of the input is changed, regardless of whether the user

That's not how text inputs work, now is it?  For much the same reasons.  There's
a difference between the user being in the process of changing the value and the
user actually changing the value.

> I'd take responsibility for that

Only if you actually stop to consider that not everyone uses the Web with a
mouse.  If you stop to think about that, kudos; experience shows that you're one
of a very very small number of such designers.
Comment 62 Hixie (not reading bugmail) 2005-09-14 04:15:15 PDT
> > since we have no way to determine when the selection finished in that
> > scenario.
> 
> When the control is blurred or the user hits enter.  That's when we fire
> onChange now.

Oh, I didn't know we did it when you hit enter (I figured that submitted the
form). Ok, that's cool.

In that case IMHO this bug should be closed, in favour of a separate bug to
implement oninput="" on <select>.
Comment 63 Joseph Myers 2005-09-21 15:13:19 PDT
I reported this bug a long, long time ago, although I think my bug was deleted 
in favor of someone who had reported it before me.

The original web page that made me irritated by Mozilla's behavior was deleted 
as well, so I could not provide a link to it.

However, I noticed that the exact same page is back up.

http://www.kcfn.net/bible-memory.html?v=2

It irritated me very much that I COULD NOT use the arrow keys to navigate 
instantly to the next verse. This is contrary to the opinion of people who have 
said users will not desire to be redirected.

I'm pointing this out because after reading many comments, I see there are only 
two reasons that onchange is not fired by using the arrow keys in a select 
element.

(1) The W3C says that onchange must be fired only when focus leaves the element.
(2) People believe that onchange may be fired prematurely when the user has 
not "completely" selected their final choice. This will be a source of 
irritation to the user when the result of their action is a complete change of 
state (such as being redirected away to another web page) which does not allow 
them to retain the ability of finishing their selection.

Note that error (2) only becomes significant in the case where the results of 
the first selection make it inconvenient to choose another selection. The most 
severe instance is obviously one where a permanent, immutable decision (e.g., 
causing an email to be sent) is made when the onchange event handler is fired.

In response to error (1), the wording of the W3C's proposal (they have 
standardized the definitions, but in and of the fact that they did not 
implement everything, their standards may only be regarded as significant 
proposals for the implementation of web standards) is somewhat vague.

Each select option can also be loosely viewed as an "element," and if "focus" 
may be thought of as being directed to a sub-element of the select menu, then 
clearly focus leaves the old option and lands upon the new option, each time 
that the user clicks or uses arrow keys to change the selected option.

But this is nothing but arguing about terms. It's useless argue about terms, 
because similar things have been said by almost everyone.

I am not "for" or "against" this bug. However, it is more important to think 
seriously about the results of error (2).

We can also argue about cases where arrow keys ought to trigger the onchange 
action. I am aware of cases both in favor of and against "fixing" this bug.

There have been film exposure calculators written for Kodak, where f/number, 
exposure value, film speed, etc., are calculated proportional to each other, 
and using the arrow keys is the way to go--not because I say so, but because 
this is the way people use it.

In Mozilla the calculator does nothing, until the user mysteriously "activates" 
his set of exposure settings, by clicking into some empty space in the web 
page, in order to remove focus from the select element where his last choice 
was made. This behavior is perfectly "workable," although several times slower 
than using the arrow keys to instantly calculate the results and compare 
several camera settings in close succssion.

I wrote one of those calculators in 1999, and you can imagine how the users 
have been affected as Mozilla originally calculated by using the arrow keys, 
and then did not. Presently, I am not affected by whether this web page still 
works or does not work.

What I am presenting by this example is also a fairly weak argument. The 
desired behavior is not being "blocked" by Mozilla, but rather the user has to 
understand how to get around it by doing something that to the uninitiated 
would seem like waving a magic wand.

But the most important thing I would like to bring up is a dicussion of the 
primary reason why people don't want onchange behavior to be triggered by mouse 
keys. Much of this discussion has been lost, because of Bugzilla's semantics 
of "closing a bug"--the discussion in a closed bug is not brought inline to the 
discussion of the bug that it was closed in favor for.

People are being directed by poorly designed scripts into being committed to 
the first course of action which happens to occur by selecting the next or 
previous element using the arrow keys.

This happens because it was not clear to the user that the select element was 
a "live" selector. Live selectors were growing very rapidly in popularity, but 
then I noticed that they sort of bumped into a ceiling. Bad scripts made bad 
use of the instant action when instant action really wouldn't have been the 
best thing. It isn't right just to put an onchange handler into something that 
really needs a submit button. A case in point is sending an email. Email people 
should know that a select menu isn't the right way to submit the email. Most of 
them are smart enough to design their web pages the right way. A much more 
difficult case is when a form designer has left out a submit button altogether, 
and somehow unexpected conditions are reached. It is not impossible for a user 
to be left with a select menu that has his desired selection, and yet he cannot 
submit the form, without changing the select menu, which results in his 
submitting the wrong selection! Thus, it becomes clear that submit buttons need 
to be used for submit buttons. A stylish web page takes a risk if it uses a 
menu for the purpose of its submit button.

However, live selectors became something that web designers grew wary of, 
because they turned out to be wrong for most people. Even menus where instant 
action was more desirable began to grow too long. It was hard for the user to 
pick the right item. There were so many items to choose that the instant action 
usually became the wrong action.

In my opinion it would be better to leave nasty web designers hangning, with 
all of their incorrect designs. Somehow people think that they can get a good 
result without changing their flawed designs. It would be ridiculous to "fix" 
this by implementing oninput, and insane to implement oninput for the sole 
purpose of "fixing" this. People would continue doing their designs wrong.

Whatever the behavior is when a user clicks on a select item and chooses the 
selection above or below, should be the same as the behavior when the user 
clicks on a select item and uses the arrow keys to select the item above or 
below.

If the onchange event handler fires, then a user who uses the arrow keys to 
make his selection will be precluded at this point from making any other 
selection. Only someone who selects his choice with the cursor will be able to 
choose something that is not adjacent to the item which is currently selected. 
Even so, the behavior is consistent.

Every user has a right to do wrong or right, and have the results of his own 
actions be the result of his own actions.

In my case, I actually wanted to have a permanent change happen (loading the 
next Bible verse) when I clicked on the select menu that showed verses, and 
used the down arrow to select the next one. I was unhappy that it did not 
happen, and the poor design of the web page meant that I would have to use 
a "magic wand" and click elsewhere on the page, in order for the onchange 
handler to be invoked. This defeated the purpose of the select menu, which was 
instant convenience. It didn't matter if I was redirected, because the 
permanent change wasn't a significant change.

I don't think that designs which make a significant decision should be using an 
instant handler device. Therefore, it must be resolved whether an instant 
handler is useful, such as a live selector menu. If it is useful, and if 
Mozilla can trust people on the Internet to design web pages (judging the 
intent of software developers or software users is not the role of an 
organization, anyway) and take the consequences for them, then a live selector 
ought to be live, either by the cursor or by arrow keys.


Comment 64 Timothy C. Quinn 2005-10-10 08:13:25 PDT
After making several posts to w3c groups regarding this issue and doing some
more real world hacks around this event functionality, I tend to agree with the
Mozilla team that this issue is not a bug and Mozilla's model is correct,
logical and even functional (onblur and enter key fires event).

For those who have issues with this, train users to hit enter key when selection
is made and make sure you set onsubmit event of form to 'return false' to
capture any auto submits.

Thanks for holding out Moz dudes. Keep up the good work!

...Removing myself from this bug...

JsD
Comment 65 Ricardo Almeida 2005-10-11 03:14:54 PDT
(In reply to comment #64)
> After making several posts to w3c groups regarding this issue and doing some
> more real world hacks around this event functionality, I tend to agree with the
> Mozilla team that this issue is not a bug and Mozilla's model is correct,
> logical and even functional (onblur and enter key fires event).

I'm sory, but you're simply plain wrong. This is a English issue, not a
standards issue. What does 'on change' means in english?! I'm portuguese, so I
may not fully understand the meaning...

And there's also incosistencies in behaviour. Why making something with the
mouse has a different behaviour than doing with the keyboard?

"f I change the SELECT with my mouse, it doesn't lose focus, but I still get the
event, which is inconsistent with the currently displayed behaviour with the
keyboard."

> For those who have issues with this, train users to hit enter key when selection
> is made and make sure you set onsubmit event of form to 'return false' to
> capture any auto submits.

Just plain wrong. Users wan't to change and don't press enter, they don't care
about any technological standards. If you said use the onChangeValueWithKeyboard
event, that would be the correct answer. People wan't to change with the
keyboard or the mouse and have the same behaviour. People don't care about
technological problems. Standards?! Scew them if they don't know the meaning of
the words! I Repeat, it's an ENGLISH problem not a technological one...
Comment 66 Boris Zbarsky [:bz] (still a bit busy) 2005-10-11 07:45:31 PDT
> This is a English issue, not a standards issue.

Um. NO.  It's a standards issue.

> What does 'on change' means in english?!

It's not well-defined, because human languages are not very good at having
precise meanings attached to words.  For example, what does "change" mean?  Why
can people ever have an argument about whether someone has "changed" over the years?

> Why making something with the mouse has a different behaviour than doing with
> the keyboard?

Because a priori the process of selecting an option with the keyboard is
different from doing so with a mouse.  WITH A MOUSE YOU DON'T HAVE TO GO THROUGH
ALL THE OPTIONS IN BETWEEN THE DEFAULT ONE AND THE ONE YOU WANT.  People seem to
miss this point, for some reason I do not understand.

Comment 67 Ricardo Almeida 2005-10-11 12:39:45 PDT
(In reply to comment #66)
> > Why making something with the mouse has a different behaviour than doing with
> > the keyboard?
> 
> Because a priori the process of selecting an option with the keyboard is
> different from doing so with a mouse.  WITH A MOUSE YOU DON'T HAVE TO GO THROUGH
> ALL THE OPTIONS IN BETWEEN THE DEFAULT ONE AND THE ONE YOU WANT.  People seem to
> miss this point, for some reason I do not understand.

Then, to have a equivalent behaviour, at least fire the onChange after half a
second or so have passed without the value changing...

I won't even argue about the meaning of change but I believe that some event
should be triggered when the user changes the selection. If not onChange, make a
onKeyboardChange event so developers can make sites that work the same in
Mozilla and in IE...

Ask some user what he wants: - A discussion of what onChange means or a site
that behaves as expected?
Comment 68 Jesse Ruderman 2005-10-11 14:02:06 PDT
I filed bug 312094 for adding support for <select oninput>.
Comment 69 Tommy Morgan 2005-10-11 14:54:09 PDT
This issue has annoyed me for a long time.  Mozilla does behave differently than
any other browser I have ever tested, but I understand the importance of trying
abide by standards.  But I don't like hearing the argument about selects used
for navigational redirection because I don't think such a common control should
have it's functionality determined by one common use.

Here's an idea that I haven't heard mentioned before: Why not make the onchange
event work like all other browsers when quirks mode is enabled and make oninput
available in standards mode?  In quirks mode you could still use onblur to
achieve the same functionality that Mozilla's current onchange provides. 
Wouldn't this satisfy most people and at the same time be even more Mozilla-like
than it is now?
Comment 70 Boris Zbarsky [:bz] (still a bit busy) 2005-10-11 15:03:13 PDT
> Then, to have a equivalent behaviour, at least fire the onChange after half a
> second or so have passed without the value changing...

Might not be a bad idea.   File a separate bug on this, and let's have the
accessibility folks check out how that works for disabled users (many of whom
who have to use the keyboard or equivalent, and whose concerns we need to make
sure to address when dealing with keyboard functionality)?

Comment 71 Ricardo Almeida 2005-10-12 02:59:46 PDT
(In reply to comment #70)
> > Then, to have a equivalent behaviour, at least fire the onChange after half a
> > second or so have passed without the value changing...
> 
> Might not be a bad idea.   File a separate bug on this [...]

I'm sorry but I don't understand if you're being ironic or not...
Supposing you're not, I don't think I should file another bug. This bug is about
triggering the onChange event when using the keyboard and I'm suggesting the
event should be triggered 500ms after the user making a change...
Comment 72 Jesse Ruderman 2005-10-12 03:42:30 PDT
I don't like the "trigger 500ms after" idea.  That won't give keyboard users
enough time to read each item as they arrow through a list.
Comment 73 Ricardo Almeida 2005-10-12 05:53:58 PDT
(In reply to comment #72)
> I don't like the "trigger 500ms after" idea.  That won't give keyboard users
> enough time to read each item as they arrow through a list.

What about trigger after 750ms, or trigger after 1sec. The ideia in itself is
trigger the event after a given amount of time has passed without any more
changes. The given amount of time is irrelevant for now as it can be easially be
a  configuration parameter defaulting to some given value...
Comment 74 Boris Zbarsky [:bz] (still a bit busy) 2005-10-12 06:10:43 PDT
> Supposing you're not, I don't think I should file another bug.

I'm not being ironic, and suit yourself.  As a separate bug, it might get fixed.
 As part of the spam-fest that is this bug, it never will be -- I suspect people
have filters in place to automatically delete any  mail with this bug number in
the subject.

If you do file this new bug, please do cc me on it.
Comment 75 Tommy Morgan 2005-10-12 08:58:36 PDT
(In reply to comment #74)
> I'm not being ironic, and suit yourself.  As a separate bug, it might get fixed.
>  As part of the spam-fest that is this bug, it never will be -- I suspect people
> have filters in place to automatically delete any  mail with this bug number in
> the subject.

Sure feels that way.  Is the amount of traffic on this not an indicator that the
current functionality is not quite right?  FWIW, I don't like the trigger after
x seconds either.  That's just odd.  It changed or it didn't.  I would like to
get some feedback on my quirks/standards mode idea though.
Comment 76 Joseph Myers 2005-10-12 09:53:20 PDT
> x seconds either.  That's just odd.  It changed or it didn't.  I would like to
> get some feedback on my quirks/standards mode idea though.

The differences between the two modes needs to be reduced. Products which 
contain divergent feature sets tend to be unsuccessful.

Comment 77 Tommy Morgan 2005-10-12 10:24:00 PDT
(In reply to comment #76)
> The differences between the two modes needs to be reduced. Products which 
> contain divergent feature sets tend to be unsuccessful.

Mozilla can't just throw quirks mode away.  It exists for a good reason and I
think this is an opportunity to utilize it.  But as a developer I certainly do
hope that one day everyone will support standards.  Coding to standards is
really nice... until you look at the page in IE ;-).
Comment 78 Jesse Ruderman 2005-10-21 21:34:52 PDT
*** Bug 303890 has been marked as a duplicate of this bug. ***
Comment 79 Jason 2005-11-07 21:24:05 PST
If you think about it... people who don't use a mouse will be forced to use the keyboard to look through SELECT items.

If cycling through the items causes the onChange to fire.. .those keyboard-only users will have a very difficult time.. especially if the onChange causes a form submit or other form elements.

I hate to say this.. but I agree... ENTER should trigger the onChange. Therefore the WC3 standard is correct and this bug is INVALID.

Here is a simplfied example of this in action:
http://www.imperial.cc/onchange.htm
Comment 80 Ricardo Almeida 2005-11-08 02:56:30 PST
(In reply to comment #79)
> If you think about it... people who don't use a mouse will be forced to use the
> keyboard to look through SELECT items.
> 
> If cycling through the items causes the onChange to fire.. .those keyboard-only
> users will have a very difficult time.. especially if the onChange causes a
> form submit or other form elements.

Cycling through the values should not make a form submission. Submit buttons should do that :p

> I hate to say this.. but I agree... ENTER should trigger the onChange.
> Therefore the WC3 standard is correct and this bug is INVALID.

I'm sorry but I disagree with you. The value changed, thus onChange should be called.

> Here is a simplfied example of this in action:
> http://www.imperial.cc/onchange.htm

2 Comments:

- Change the size of select box to 2 and explain why is acceptable to trigger the onchange on changing with the keyboard. People still have to use the keyboard to cycle through the options.

- I've opened with the browser used by around 90% of the people and it had the behaviour that at least those 90% expect: Changing the value with the keyboard triggers the onChange event. So, for at least 90% of the Web users Mozilla has a bug.
Comment 81 Simon Wunderlin 2005-11-08 04:41:57 PST
this bug is marked wontfix for a long time. i guess adding protest comments doesn't change that. it's a matter of fact that mozilla's onchange doesn't fire onchange and therefore is incompatible with (probably) all other browsers just becasue some webedevelopers use sloppy techniques i do not think such a radical change in functionality is justified.

Sad to say that this problem makes firefox less usable than it could be actually.
Comment 82 Timwi 2005-11-08 11:59:06 PST
Is there an extension that changes the behaviour of onChange in the way people are proposing? If not, is it because it's not possible to do this in an extension? If so, maybe a new bug should be filed to request an enhancement to make that possible.
Comment 83 Mats Palmgren (:mats) 2006-06-30 14:44:45 PDT
My 2 cents: I'm in favor of changing this so that we do fire OnChange
also when selecting a new value using the keyboard. This is what IE6/XP,
IE7b2/XP, all four combinations of Opera8/Opera9 on XP/Linux,
Safari(nightly)/OSX 10.4.6 do, which makes me comfortable that sites don't
have obstructive OnChange handlers in general. Being incompatible is
likely more of a problem (as this bug seems to suggest).

(FYI, "Patch rev. 2" in bug 231830 also fixes this bug)
Comment 84 Boris Zbarsky [:bz] (still a bit busy) 2006-06-30 15:02:09 PDT
> which makes me comfortable that sites don't have obstructive OnChange handlers
> in general

You're way too optimistic.  I run into such handlers all the time, whereas I've never run into issues due to the current Gecko behavior -- just hit enter once I have the thing I want selected.
Comment 85 Mats Palmgren (:mats) 2006-06-30 15:09:06 PDT
(In reply to comment #84)
> I run into such handlers all the time...

Do you have an example? (or more) - I'd like to understand why those sites
does not cause problems for the other UAs I mentioned.
Comment 86 Hercules Gunter 2006-07-02 18:41:48 PDT
The important point to focus on here is that the Gecko engine is almost certainly the only browser engine to exhibit this behaviour, and likewise almost certainly the only implementation of a combo box to exhibit this behaviour.  Every other browser triggers onchange when the text in the display box changes, and this has to be the only logical interpretation of the word "change" in the event name.

Yes, some sites abuse the dropdown list, and you get undesirable behaviour.  In the same way, some drivers abuse cars, and cause crashes.  This does not mean that all cars should be designed to crash.  This odd and unusual behaviour by Gecko makes some situations hard to program, so that the user experience for mouse-challenged users in Gecko-based browsers is frustrating for them because they have to keep hopping in and out of the dropdown to see the effect of choosing a different value in the dropdown.

This issue has been raised over and over again.  It's time something was done about it!  The objection to the change is because if someone uses the dropdown as a navigation tool, use with a keyboard can be frustrating because you zap off elsewhere.  This is not what a dropdown should be used for: it is a tool for selecting one of a list of values (Note: NOT destinations).
Comment 87 Arun Nallan 2006-07-03 12:36:27 PDT
I agree with Gecko with the current standard. Moreover, I see that gecko is supporting "Typing in the combo box" to select any item by spelling from the dropdown list. I guess this feature is a nice one that everybody would want and has a competitive edge over IE.

Also, triggering 'onChange' when using the keyboard while selecting the values in the dropdown, would compromise on the features that are already available like the one above.

Pressing 'Enter' key should resolve any issue in the website for which onChange event needs to get triggered.

My vote for Wont Fix!
Comment 88 Ricardo Almeida 2006-07-03 16:19:29 PDT
(In reply to comment #87)
> [...] "Typing in the combo box" 
> 
> Also, triggering 'onChange' when using the keyboard while selecting the values
> in the dropdown, would compromise on the features that are already available
> like the one above.

Explain me as if I'm really dumb... I don't undertand why triggering the onchange would make it stop working. It would probably execute the associated script more times than required but I don't see a problem with that.

> Pressing 'Enter' key should resolve any issue in the website for which onChange
> event needs to get triggered.

It's not the natural behaviour... ALL other browsers don't have this behaviour. Maybe you should start asking yourself why.

> My vote for Wont Fix!

My vote for Fix It as fast as you can, please.
Comment 89 CPK Smithies 2006-07-03 16:43:08 PDT
I agree with those who would like to see this fixed. If a mouse/keyboard action causes the selected item to change, then the onchange event should be fired. It seems nonsensical to think that one could somehow navigate to a select field, cause its contents to change and then submit the form without the onchange event firing.

There is an issue, too, with the default behaviour. In IE and the versions of Mozilla/Firefox that I am using, typing an alphanumeric key when a select field has focus causes the first/subsequent option with that initial character to be selected. I have used a script to implement incremental search (so that a second character typed does not replace or override the first, but supplies a second character to the search mask). Supplying an override onchange handler in IE defeats the default behaviour and the incremental search works fine. In Mozilla, however, it works only if you type really quickly. Type slowly and the default behaviour overrides the scripted behaviour. It's as if the default handlers are programmed to sneak in on some kind of timeout (although I could be wrong!).

I think that default onchange behaviour should be overriden by programmed onchange scripts. Or there should be a documented way to defeat the default onchange behaviour (e.g. returning status from the onchange handler).

CPK Smithies
Comment 90 Jesse Ruderman 2006-07-03 17:21:44 PDT
(In reply to comment #89)
> I agree with those who would like to see this fixed. If a mouse/keyboard action
> causes the selected item to change, then the onchange event should be fired. It
> seems nonsensical to think that one could somehow navigate to a select field,
> cause its contents to change and then submit the form without the onchange
> event firing.

Onchange is fired when the dropdown loses focus, or when you press enter.  As far as I know, the onchange event does always fire before the submit event.

> There is an issue, too, with the default behaviour. In IE and the versions of
> Mozilla/Firefox that I am using, typing an alphanumeric key when a select field
> has focus causes the first/subsequent option with that initial character to be
> selected.

In the version of Firefox I'm using, typing several letters into a dropdown (without waiting too long) does what you want, so you shouldn't need a script to override it.
Comment 91 CPK Smithies 2006-07-03 18:11:20 PDT
(In reply to comment #90)
> In the version of Firefox I'm using, typing several letters into a dropdown
> (without waiting too long) does what you want, so you shouldn't need a script
> to override it.

Yes, it's that "(without waiting too long)" that is the issue. Who says what is "too long"?

And in a way even that is irrelevant. Ordinary users just can't cope with a user interface that does different things depending on the speed at which they type. And I don't blame them one little bit. Imagine a user who is not (perhaps) totally focused on what they're doing, or who is subject to random interruptions. Add the possibility that they are not fast typists. That (I should think) characterizes 99% of web form users. And here we have a user interface that changes behaviour depending on their typing speed.

Such a thing could only be designed by people who do not live in the real world.

It is not to be wondered at that someone should try to script something more predictable to override that, and the fact that it isn't overridable is, it seems to me, a serious problem given that some designers may need to do special scripting for disabled and slow users, or for special applications.

CPK Smithies
Comment 92 Brendan Eich [:brendan] 2006-07-03 18:20:01 PDT
(In reply to comment #83)
> My 2 cents: I'm in favor of changing this so that we do fire OnChange
> also when selecting a new value using the keyboard. This is what IE6/XP,
> IE7b2/XP, all four combinations of Opera8/Opera9 on XP/Linux,
> Safari(nightly)/OSX 10.4.6 do, which makes me comfortable that sites don't
> have obstructive OnChange handlers in general.

We lose.  There's no point in being odd browser out here.  BTW, I'm bugged by this bug too.

Boris, if you can identify sites that misbehave if we fix this bug, please list them.  If they would misbehave with all the above-mentioned browsers too, they will be easy TE targets. If they are somehow misbehaving only for Gecko (with a fix for this bug), then why?

/be
Comment 93 Timwi 2006-07-04 04:04:13 PDT
> I have used a script to implement incremental search [...]

This bug is about the onchange event. However, it seems what you are looking for is onkeydown.

In general, I tend to use onkeydown in addition to onchange if I want Gecko-based browsers to behave the expected way.
Comment 94 CPK Smithies 2006-07-04 05:52:02 PDT
(In reply to comment #93)
> > I have used a script to implement incremental search [...]
> This bug is about the onchange event. However, it seems what you are looking
> for is onkeydown.
> In general, I tend to use onkeydown in addition to onchange if I want
> Gecko-based browsers to behave the expected way.

My script does use onkeydown. On reflection, perhaps my problem should be reported separately. In essence, it is primarily that scripted onkeydown behaviour doesn't defeat the default onkeydown behaviour in Mozilla/Firefox, and secondarily that ordinary users find the default behaviour unpredictable.
Comment 95 Boris Zbarsky [:bz] (still a bit busy) 2006-08-04 08:53:10 PDT
(In reply to comment #85)
> Do you have an example?

I'll be happy to dump some in this bug as I run across them.  Of course that requires browsing with non-Gecko browsers, which I don't do very much anymore.  I did have 3-4 very popular examples a few weeks ago, but since I wasn't cced on this bug I didn't realize people actually wanted them...

> I'd like to understand why those sites
> does not cause problems for the other UAs I mentioned.

Who ever said they don't?  To make these sites usable with a keyboard in non-Gecko browsers, you have to keep remembering to alt-down before making your selection instead of just arrowing to it.  It's a royal pain in the behind -- you either have to memorize which sites are the sucky ones, or arrow down, get a nasty shock, hit back, and try again.  I suggest you try browsing the web for a day or two with IE using only the keyboard.  Make sure to hit lots of popular game sites and other top100 stuff and such when you do.

Brendan, site authors have zero interest in actually making their sites usable for keyboard users in my experience.  Good luck evangelizing them; we've had no luck with that sort of thing in the past.

If you feel that we should switch the default behavior to be compatible with other browsers, I could perhaps buy it if there is an accessibility option to have the current behavior.  Of course that involves us maintaining (and testing!) two different codepaths, which is rather unfortunate.
Comment 96 Boris Zbarsky [:bz] (still a bit busy) 2006-08-04 08:59:16 PDT
OK, I decided to try using Opera for a day.  About 5 minutes later, while planning a trip, I run into <http://transitchicago.com/maps/bus/bus.html>.  Try to get the bus schedule for the #57 bus, say.  More reports as I run into them.

Comment 97 Boris Zbarsky [:bz] (still a bit busy) 2006-08-04 09:07:14 PDT
Another 2 minutes after that, I run into <https://webmail.mit.edu/> while looking for some old mail.  Unfortunately, this requires a login, but if you have access to some other IMP webmail system (<http://www.horde.org/imp/>) I suspect they all behave about the same.  There are two comboboxes on that site that have the behavior we're interested in.  The first is the "Select" combobox (where you can select "all", "unseen", "answered", "not answered", etc).  The second one is the "Mark as" combobox (where you can select things like "seen", "deleted", etc).

Trying to use these with the keyboard would typically make you mark all your mail as seen in non-Gecko browsers.

I should note that having to type all this up really affects the speed at which I can browse.  ;)
Comment 98 Boris Zbarsky [:bz] (still a bit busy) 2006-08-04 09:43:29 PDT
OK, I had to stop the Opera experiment, because it kept completely hanging every time it ran into a PDF.  I've been mostly dealing with bugzilla since my last comment, and I can report that bugzilla does not abuse onchange... ;)
Comment 99 Mats Palmgren (:mats) 2006-08-04 10:45:08 PDT
Ok, I was probably too optimistic regarding abuse of 'onchange'.
I'm still in favor of fixing this bug though, then file TE bugs for
the broken sites. I think it's worth gaining compatibility in this case.


FWIW, 
http://whatwg.org/specs/web-forms/current-work/#forms-events-model
"In [DOM3EVENTS] and [HTML4], the change event is fired on a form
control element when the control loses the input focus and its
value has been modified since gaining focus.

This specification changes these semantics to more accurately
reflect the behaviour expected by Web authors. Specifically, for
controls implemented with a non-editable stateful UI (e.g. select
elements, checkboxes, or radio buttons as deployed in typical desktop
Web browsers), the change event shall be fired when the selection is
completed, even if the control does not lose focus."
Comment 100 Boris Zbarsky [:bz] (still a bit busy) 2006-08-04 10:54:39 PDT
That text depends on the definition of "selection is completed".  For example, if I hold down the down arrow key, selection is not completed until I release it.  How is pressing the down arrow key a bunch of times in a row different?

As I said, if people really want compat I'm ok with it as long as the current behavior remains available to people who actually use the keyboard.
Comment 101 Brendan Eich [:brendan] 2006-08-04 11:01:34 PDT
(In reply to comment #100)
> That text depends on the definition of "selection is completed".  For example,
> if I hold down the down arrow key, selection is not completed until I release
> it.  How is pressing the down arrow key a bunch of times in a row different?

We could use a timer, if you haven't pressed and released quickly enough, the selection is complete.  My Macbook love affair has been tempered by interaction with similary timer-based magic to disambiguate mousedown-and-sweep-or-drag from mousedown-for-context-menu.  Ugh.

> As I said, if people really want compat I'm ok with it as long as the current
> behavior remains available to people who actually use the keyboard.

Pref for a11y seems like the least we should do.  But can we do better?

/be
Comment 102 Aaron Leventhal 2006-08-04 11:08:29 PDT
Timers are bad for users with physical disabilities.
Comment 103 Brendan Eich [:brendan] 2006-08-04 11:46:26 PDT
(In reply to comment #102)
> Timers are bad for users with physical disabilities.

Including me -- half the time on my Mac, I try to drag something (a mail message to a folder in mail.app, e.g.) and I get the context menu cuz I'm slowing down in my old age.

/be
Comment 104 kitchin 2006-08-14 07:02:57 PDT
Site which uses drop-down navigation:
http://cnn.com
(bottom of page, language selection)
Keyboard navigation is horked in IE, but good in Mozilla.

My suggestion:
The initial down-arrow should scroll out the list, like alt-down-arrow now does.    Once the list is scrolled out, all browsers behave the same, waiting for Enter before firing onChange.  Simple fix, and sites CNN would still work using the keyboard.  Is it standards compliant?  How would it work with a text-reader, or do text-readers ignore Javascript?  

Similarity to Drop-downs in other windowing systems:
Is the current alt-down-arrow vs. down arrow based on some standard?  It conforms with the MS Windows shortcuts for a ComboBox, but in Windows I see onChange firing whenever down-arrow hits a new item, whether the list is scrolled out or not.  (I'm using an old Delphi 3's TComboBox form element, so it's possible the actual Windows API differs.)  So the the onChange event in MS Windows ComboBox does not match any of the various web browsers.  I don't know about other windowing systems, or how much it matters, compared to W3C standards and dominant browser behavior.
Comment 105 kitchin 2006-08-14 07:28:40 PDT
Here's an alternative suggestion:

If the scroll box has a (non-chrome) onChange handler attached, then...
the initial down-arrow should scroll out the list, like alt-down-arrow now
does.  

It has the benfit of giving the user a visual clue that some immediate action is likely to follow selection.

I realized that my initial suggestion would change user experience for people who keyboard navigate, presenting more visual clutter and requiring on extra click on the arrow.  This alterative would reduce those cases.
Comment 106 Timwi 2006-08-14 08:06:31 PDT
How does your suggestion handle the case where I start typing letters after focussing the drop-down box? Do you still think it should open the drop-down then?
Comment 107 kitchin 2006-08-14 10:36:44 PDT
Yes, but only if an onChange event is attached.  Otherwise it's obtrusive.  I tried CNN.com in IE: focused the language select at the bottom of the page, typed "A" and was sent to the Arabic site.  That seems wrong.  Mozilla's behavior, to wait for enter or tab,  seems right, for that type of navigational menu.

On pages that use <select> onChange otherwise, such as to populate page elements, my suggestion would make it obvious that the user needs to press enter or tab to see the results.

Example URL for non-navigational use of <select> onChange:
http://www.napaonline.com/
click "Change Vehicle" near the top of the left column.
On the form are three <select> elements: Year, Model, Make.
Model and Make are <select disabled>.
Year is <select onChange="...populate Model...">.
Etc.

Note the Napaonline.com form is probably impossible to use with keyboard-only navigation. It is actually worse in IE.  The problem is that when Javascript tells the DOM to enable the next <select>, you still cannot tab to it.  But you can tab in if you use the mouse to click on text nearby the element. It is not a <label> so I don't know whats's going on there.  Bug?

Also in IE, it is very easy to get a Javascript error popup by continuing to down-arrow through one menu while the other is populating (the site is generally slow and it uses a type of semi-Ajax to populate, by setting the <iframe>'s ".src" property to a URL get, which loads in an HTML document with Javascript that does the work).

In other words, even this type of non-navigational menu shows the weakness of IE's behavior of down-arrow firing onChange.  Web designers just don't test keyboard navigation that well.
Comment 108 Hercules Gunter 2006-08-23 18:40:22 PDT
The issue here is not what can be done for Gecko to get around misuse of the dropdown list as a naviagation selector (it's a data input device, nothing else) and behave even more wildly at odds with other browsers.  The issue is that the Gecko engine does not have standard behaviour, and that is what should be worked towards.

That CNN behaves badly when you use the keyboard on its dropdown boxes is an indictment of the behaviour of CNN's site, and it will do exactly this for users of any other browser engine.  This issue should be raised with CNN, who should be taking care to make their site browser-neutral.

Where this issue raises problems is when one is trying to script the behaviour of the control and update other parts of a form in response to the change in dropdown selection.  The worst issue is if the next field is hidden as a consequence of the value change and suddenly nothing has the focus if you just tabbed out of the control to get the event triggered.

The behaviour should be that if the contents of the text portion of the control have changed, the event trips; if one is scrolling through the list in expanded form without yet selecting a new value, it hasn't changed and therefore no event.  If one is doing this with a collapsed list using the keyboard, the value has changed and therefore an event should take place.  This is surely the most obvious interpretation of the event name?
Comment 109 Boris Zbarsky [:bz] (still a bit busy) 2006-08-23 18:53:06 PDT
> The issue is that the Gecko engine does not have standard behaviour, and that
> is what should be worked towards.

The real issue is what would be best for users of Gecko (and I don't mean website authors here; I mean people using the browser).

I'm not sure why there should be a difference between scrolling through depending on whether the <select> is expanded or collapsed; I have yet to see anyone clearly explain to me why these two cases should lead to wildly different behavior.
Comment 110 CPK Smithies 2006-08-23 21:06:32 PDT
Agree with #108.

In addition I reiterate that it is possible to filter unwanted event firings by hooking them. When they don't fire, there is nothing the UI designer can do. As things now stand, the behaviour is inconsistent, unpredictable and not overridable.

At the very least, it should be possible to get the effect the application requires by using appropriate event handlers. Currently it is not. The inconsistency has been caused by too much "clever" programming and second-guessing how designers should or might use select controls. "Clever" programming should be delegated to the page designer and should be confined to his own scripts, not be embodied in the browser and inflicted on the rest of the community!
Comment 111 CPK Smithies 2006-08-23 21:07:33 PDT
Agree with #108.

In addition I reiterate that it is possible to filter unwanted event firings by hooking them. When they don't fire, there is nothing the UI designer can do. As things now stand, the behaviour is inconsistent, unpredictable and not overridable.

At the very least, it should be possible to get the effect the application requires by using appropriate event handlers. Currently it is not. The inconsistency has been caused by too much "clever" programming and second-guessing how designers should or might use select controls. "Clever" programming should be delegated to the page designer and should be confined to his own scripts, not be embodied in the browser and inflicted on the rest of the community!
Comment 112 Hercules Gunter 2006-08-23 21:27:27 PDT
The issue is NOT what someone thinks would be best for users of Gecko, but what users have come to expect from controls of this type.  The experience should be the same no matter what browser or OS-native application they use - and Gecko's behaviour is different from every other incarnation of the dropdown list I have ever encountered.

In the bad old days, application interfaces were pretty much unique to each program one used, and when you used a new package you had no idea what to expect would be required to drive.  The IBM Common User Access (CUA) standard initiative changed all that and brought order out of chaos, and subsequently software which conformed to that was familiar the first time you used it.  This is what we should be able to expect from browsers.

Gecko should be brought back to the mainstream, and should behave the way it does in other contexts, be that Web browsers, Windows apps, Macintosh apps, whatever.  A dropdown list is an input device, not a navigation tool, and should be used only as such.
Comment 113 CPK Smithies 2006-08-23 21:30:12 PDT
Sorry for the double posting earlier - don't know what happened there.

Just wanted to address a point in #66: it is incorrect to assume that with a select control, the keyboard forces users to pass through all intermediate steps from the default option to the desired one. Typing letter keys can take one there directly, or (using incremental search) through very few intermediate steps.

Of itself, this is neither here nor there; I make this point only to remove a possible justification for inconsistent treatment of mouse and keyboard interaction with the same control. (Which inconsistency would be fine if one could add event handlers to solve it!)

(Agree with #112 also.)
Comment 114 Brendan Eich [:brendan] 2006-08-23 21:46:09 PDT
Folks, let's not repeat ourselves if we can help it.

I'm the perpetrator of select onchange= (with help from front-end hackers, in Netscape 2, the dawn of JS).  I think we should change, see comment 92.

Authors will change their content to be more keyboard navigable due to Sec 508 in the U.S.  FWIW.

If there were a way to distinguish cases so that we could do right by keyboard users most of the time, and be compatible by default in the common case -- and without using a timer, that would be wonderful.  Otherwise, then how is any amount of keyboard navigation goodness for Gecko-based browser users ever going to spread to other browsers?

Boris, from comment 95 it sounds like you would be ok with matching the de-facto standard by default, if there were a pref.  Are you still ok with this change?

/be
Comment 115 Simon Wunderlin 2006-08-24 03:32:36 PDT
Created attachment 235225 [details]
Javascript workaround example

Even if this behavour gets fixed in later Mozilla versions it wil lstill exist in older Versions.

I needed a fix for this behavour and have found something interesing (This is tested in firefox 1.5.x on w2k and epiphany 1.4.8 debian sarge):

When navigating trough a select tag (size=1) with the keyboard, the onchange event is not fired as reported. However, the select's `selectedIndex` property is updated.

You may add this fix to your page. it will attach an event listener to all select elements. on keyup it will then call the onchange event handler.

This is a hack and is not perfect (plese provide fixes if you have better ideas/implementations). 

One problem at the moment ist, that the onchange event is fired when navigating trough the select with the arraow keys (as expected) but also when the SELECT tag looses focus (this is the time gecko will actually fire the onchange event). Just keep this in mind. if you are doing something cpu intensive you might want to prevent the extra onchange beeing fired in some way.
Comment 116 Timwi 2006-08-24 08:09:08 PDT
You know what annoys me most about this bug? It's not the bug itself, and it's not the comments or the arguments or the discussion.

It's the fact that the Powers That Be™ have already made up their mind, and are not going to be swayed by any amount of arguments, no matter how reasoned and valid.

People are going to continue discussing this in here until the end of Mozilla, futilely. That makes me sad.
Comment 117 Brendan Eich [:brendan] 2006-08-24 09:21:10 PDT
(In reply to comment #116)
> You know what annoys me most about this bug? It's not the bug itself, and it's
> not the comments or the arguments or the discussion.

Useless comments are more annoying to most people.

> It's the fact that the Powers That Be™ have already made up their mind, and are
> not going to be swayed by any amount of arguments, no matter how reasoned and
> valid.

Watch that victim complex.

If I'm not a power-that-is, I guess I'm just spamming this bug too.  We'll see.

> People are going to continue discussing this in here until the end of Mozilla,
> futilely. That makes me sad.

Want to bet?

Useful (I hope) content: What do people think of the suggestion in comment 105, elaborated in comment 107?  It was not clearly shot down.  Is that possibly the basis for a synthesis that makes most cases work via keyboard as well as mouse?

/be
Comment 118 CPK Smithies 2006-08-24 09:33:49 PDT
(In reply to comment #117)
> What do people think of the suggestion in comment 105, elaborated in comment 107?

Seems good to me. At the same time, I'd recommend that entering alpha keys into a select control should also be taken into consideration, and that timeouts should never be used to influence the response of the control to keyboard input.
Comment 119 Timwi 2006-08-24 10:20:36 PDT
The entire problem is that Mozilla/Firefox/Gecko behaves differently from any other browser.  Comments 105 and 107 do not address this at all; quite to the contrary, they are suggesting to make it even worse, by making Mozilla/Firefox/Gecko behave inconsistently even with itself.
Comment 120 Timwi 2006-08-24 10:24:35 PDT
> and that timeouts
> should never be used to influence the response of the control to keyboard
> input.

This would mean that, and soon as you type a wrong character, you are screwed.  The time-out exists in other drop-down box implementations to alleviate that problem.
Comment 121 Brendan Eich [:brendan] 2006-08-24 14:05:35 PDT
(In reply to comment #120)
> > and that timeouts
> > should never be used to influence the response of the control to keyboard
> > input.
> 
> This would mean that, and soon as you type a wrong character, you are screwed. 
> The time-out exists in other drop-down box implementations to alleviate that
> problem.

Yet timeouts are considered an a11y problem (see comment 102).

(In reply to comment #119)
> The entire problem is that Mozilla/Firefox/Gecko behaves differently from any
> other browser.

That's not "the entire problem" or we wouldn't have any controversy.  Rehashing.

The other problem, from the other side of the dispute, is all the broken web sites out there, and how they're unusable when navigating via the keyboard.

One way out, which comments 105 and 107 point toward, is to evolve the widget so it works better for keyboard users without breaking the de-facto standard (much). If this is not possible, let's see a definitive proof and I will cut the Gordian knot in favor of de-facto standard compatibility, with a pref for bz and others who are accustomed to Gecko's longstanding behavior.

If, on the other hand, some new synthesis of logic could make both mouse and keyboard behavior better according to both sides of the dispute, then let's do that and stop all the repetitive posturing about what "the entire problem" is.

/be
Comment 122 Hercules Gunter 2006-08-24 17:06:36 PDT
I cannot agree with the comment about the de facto standard or broken sites.  These statements are valid only in the context of Gecko, and those sites are violating the de facto standard and broken for every other browser, of which IE is still used by the vast majority of users.  In other words, those sites are "broken" for the majority of users out there.  It's the sites which should be fixed.

Bear in mind that Gecko does not exist in a vaccuum.  It is one browser in common use, and a minority player, even if a large minority.
Comment 123 Brendan Eich [:brendan] 2006-08-24 17:34:20 PDT
(In reply to comment #122)
> I cannot agree with the comment about the de facto standard or broken sites. 
> These statements are valid only in the context of Gecko, and those sites are
> violating the de facto standard and broken for every other browser, of which IE
> is still used by the vast majority of users.  In other words, those sites are
> "broken" for the majority of users out there.  It's the sites which should be
> fixed.

That is easier said than done.  In the mean time, browsers than can handle both "correct" and "broken" sites, and innovate in ways that add accessibility, can gain market share.  Not that Firefox is obviously doing that in this instance, since the benefits that bz cites in comment 96 and comment 97 can't be traded off against the pain that others feel on different sites.

My point is that it is often possible to have our cake and eat it here.  Firefox 1.0 shipped with Gecko support for "undetected document.all" abusage, and gained market share thereby, without encouraging more bad practice in content.  That change scandalized some folks, but it's a rational consequence of game theory applied to minority market share browsers.

For this bug, gaining market share is why I say the default right answer is to match other browsers' onchange behavior.  But if we can forge a new synthesis that is mostly or entirely compatible, but has better a11y, then we should not miss the opportunity.

> Bear in mind that Gecko does not exist in a vaccuum.  It is one browser in
> common use, and a minority player, even if a large minority.

Like, duh.

Let's take off the ideological blinders.  The de-facto standard is not the last word, or the best way, just because it is a standard.  We should match it exactly if we can't find a way to improve it without breaking compatibility (much, or at all).  It could be that this is not the bug in which to innovate, and we should focus our energy on supporting the oninput attribute.

I'm not going to wait too long for a "new synthesis", and I've already said that I favor us matching other browsers by default if we can't do better.  So I would appreciate it if comments other than "me too" and the like focus on whether it's possible to synthesize behaviors into a coherent, mostly-compatible whole.

/be
Comment 124 Hixie (not reading bugmail) 2006-08-24 17:50:17 PDT
Per:

   http://whatwg.org/specs/web-forms/current-work/#the-change
   http://www.w3.org/TR/web-forms-2/#the-change

...the event fires when the selection is complete. In the case of keyboard input, the selection is not complete when the user uses arrow keys. In the case of mouse input, a click does indeed complete the input. If the user with a keyboard opens the drop down, then selects something, then closes the drop down, then the event should fire.

The "input" event is closer to what it sounds like people want here. It would fire whenever anything changed at all due to user input.
Comment 125 Hercules Gunter 2006-08-24 19:33:39 PDT
Brendan Eich: Sarcasm is not a good approach, nor using "duh"-type remarks.  It will generally result in a flame war, so inflaming such is not a good idea.  I respond in an attempt to engage the intellect, not the emotions.

I have no ideological blinders on.  My point is that the de facto standard must be followed, and Gecko doesn't do that.  I'm not particularly in favour of mucking about trying to enhance the behaviour, and would prefer it to do just what it was originally designed to do.  Interface behaviour should be consistent and expectable, and this is a standard interface device.  I won't kick against additional features, as long as the thing behaves as I expect it to and the enhancements do not intrude in any way.  I would not try to exploit the behaviour programmatically, since that would make my code browser-specific and not browser-neutral.

Hixie:  The keyboard can be used two ways with a dropdown.  Alt+Down arrow in Windows will cause it to open the list, and then the keyboard can be used to select from the list without changing the displayed text value until you press enter, when the displayed value does change and an onchange event is fired.  The alternative is to use up/down without opening the list, in which case the displayed text changes with each key depression, and in this case the onchange event should happen, but doesn't in Gecko only (amongst software I know of [except that some Unix-based code doesn't react to the keyboard at all, which is entirely unacceptable, but I don't want to go there]).  This last behaviour is what all this debate is about.

Fixing the Web sites which abuse this control is irrelevant - their problem is their problem, and if they discourage their users by bad behaviour, only they should care.  The bad thing is making behaviour wrong for all the other sites which don't abuse the control, and I have personally never run into a site which does use the thing as a navigation tool.
Comment 126 Mats Palmgren (:mats) 2006-08-24 19:40:36 PDT
The only solution I can think of that does not involve timers is to make
UP/DOWN actually open the menu, like comboboxes on Mac do. Since we need
to implement that behaviour on Mac anyway my thought was to make it
a hidden pref that people could use on other platforms as well.

I still think we should fire onchange on UP/DOWN, by default, to be
compatible with all other major UAs (see comment 83). It's unfortunate
that the de-facto standard contradicts Web Forms 2.

Is it to late to change WF2 to say that to get the new input/change
behaviour you need to have a (possibly empty) 'oninput'?
Comment 127 Brendan Eich [:brendan] 2006-08-24 21:25:07 PDT
(In reply to comment #125)
> Brendan Eich: Sarcasm is not a good approach, nor using "duh"-type remarks.

Look to your own words.  You repeated the same pedantic reminder that Gecko is not the only browser rendering engine out there.  We know this.  Don't spam this bug with repetitive pedantry.

> Fixing the Web sites which abuse this control is irrelevant - their problem is
> their problem, and if they discourage their users by bad behaviour, only they
> should care.  The bad thing is making behaviour wrong for all the other sites
> which don't abuse the control, and I have personally never run into a site
> which does use the thing as a navigation tool.

I know, that's why I keep supporting us changing to match other browsers, absent a new synthesis.  But your attitude and logorrhea really make me wonder if I'm on the right "side" here....

/be
Comment 128 Jesse Ruderman 2006-09-24 04:57:43 PDT
*** Bug 353968 has been marked as a duplicate of this bug. ***
Comment 129 Brad 2007-01-05 10:42:18 PST
I was reading theses posts and fuond it quite funny. I agree, the W3C standard is wrong, IE has it right, and FireFox needs to use update onchange when keyboard key is pressed. Personally, I just set the onkeydown event to be the same as onchange.

Alot of you say people use dropdowns for navigation.. to that I say pah... they need to get with the times. And just to let you know, it's more common now to use AJAX changes with dropdown controls than it is redirects. And again, who selects where they are going to be redirected to with the keyboard?

Browsing a selection with the keyboard implies you want to view each selection one at a time and see the changes. Using the mouse implies you want to view all the selections at one time, and choose from a broad list. The latter is what happens with a redirect box.. not what all these developers want to do, because if it was, it wouldn't be reported as a bug.

Change this!
Comment 130 Aaron Smith 2007-08-27 07:29:09 PDT
Say you have two combo boxes. The first one is enabled. The second is disabled. The first one has an onChange attribute that makes an XMLHttpRequest to dynamically populate the second combo box. Once the second combo box gets populated successfully, it becomes enabled. 

The current Firefox keyboard implementation of onChange (where the control must get blurred before any action takes place) in this example means that when you tab off of the first combo box, instead of focus going to the second combo box, focus immediately goes to the address bar, because the second combo box is still populating, and therefore has not become enabled (regardless of how fast the population and enabling happens -- even on a LAN where the result is visually instant, this behavior remains; tab still goes to the address bar). 

Not only is this a usability issue, but it is also an accessibility issue, because focus is taken off the page completely, leaving a blind or visually impaired user in the dark (no pun intended).
Comment 131 Timwi 2007-08-27 17:15:28 PDT
(The stance of the people who don't want to implement this is that you can press Enter on a drop-down box to trigger the onChange event without de-focusing it. Of course, that stance does not address your example of a blind or visually impaired user, who cannot see that there is a disabled drop-down box (no pun intended) and has no way of knowing that it would be wise to press Enter, or indeed that there is any XMLHttpRequest going on that dynamically changes the website.)
Comment 132 Paul 2008-01-11 21:51:48 PST
I am dismayed that, amongst this worthy debate, not one person has mentioned ADA standards*. People with certain disabilities may only be able to use a keyboard (or a device that simulates keyboard actions) to navigate the web.  

Java_script_Dude commented "For those who have issues with this, train users to hit enter key". Certain people, due to a handicap, may not be "trainable". In fact, after familiarizing oneself with ADA standards, it's likely many designers will agree that the only retraining required is that of the web programmer's methodology. ADA standards work quite well for non-handicapped persons too.

Perhaps one remedy is for the W3C to create a new Event that is unique to (triggered by) a keyboard action only.

Either way, like many others, I await an suitable resolve.
 
*The ADA Standards for Accessible Design apply to new construction and alterations covered by the Americans with Disabilities Act (ADA). For more info, visit here: www.usdoj.gov/crt/ada/stdspdf.htm

 
Comment 133 Roman R. 2008-03-25 01:01:05 PDT
(In reply to comment #3)
> http://www.w3.org/TR/html401/interact/scripts.html#adef-onchange -- <q>The
> onchange event occurs when a control loses the input focus and its value has
> been modified since gaining focus.</q>
> 
> Definately should be wontfix.

If the developers truly wanted to implement the behavior like that, they got it wrong because expanding the list, changing selection, and pressing Enter calls onChange. So, current implementation conforms to neither the W3C recommendation nor users' expectations.

My recommendation: drop the one-click-bookmarking nonsense and fix this problem. Otherwise, websites will have to have to be marked with "Optimized for Internet Explorer" :)
Comment 134 Roman R. 2008-03-25 01:03:09 PDT
Just in case I wasn't clear: "expanding the list, changing selection, and pressing Enter" is done by keyboard, and the focus remains on the select element.
Comment 135 Aiko 2008-06-04 09:49:20 PDT
Pretty ironic that the "Download Day 2008" page has joined the ranks of those idiotic pages abusing select onchange for navigational purposes. Try to change the language with JS disabled: doesn't work; try to change the language with the keyboard in IE from English to Italian and you get the Spanish page. A great example that too many webmasters just don't learn and that's why Gecko should keep its current behaviour. Please restore the WONTFIX resolution and implement the oninput event.
Comment 136 Brad 2008-06-04 11:03:27 PDT
Aiko: Its half about the written standards. They say onchange fires when the object loses focus yet clicking an option keeps focus and so does clicking and then using the keyboard.

Also, just FYI, standards and program operation should be implemented for the majority, not the minority =). And the majority of us want to use AJAX controls and not have to have our function on onchange and onkeypress

Thirdly, people who browse with javascript disabled won't be able to view almost any site on the internet, and they are holding back internet evolution so I hope they have a hard time =)
Comment 137 Hercules Gunter 2008-08-13 17:39:58 PDT
This was first reported in 2002-02-19.  In five days it will be  siz and a half years this idiocy has been going on.  The effectiveness of open source projects at work!  Also a triumph of democracy, in its way.  A couple of people who like using deviant navigation techniques stand in the way of millions of users.

It seems worth stressing that this is an input device, and the behaviour as implemented is inconsistent with other browsers, other identical input devices in non-Web environments, and user expectations.

It's time this was sorted out.  That it is still reported and commented on regularly means it's not going to go away, and the Mozilla user base is getting frustrated.
Comment 138 Timwi 2008-08-14 03:48:54 PDT
Hm... Why is this bug still "NEW" and not marked "WONTFIX"? Most other significant problems with Mozilla products are marked "WONTFIX", and this one here is not being ignored any less than they.
Comment 139 Ryan Jones 2008-08-14 03:53:09 PDT
The more that you guys spam this bug, the less inclined the devs are going to be in fixing it. They know the bug is here and when it is needed it'll be fixed, if you want it done sooner then learn to code and fix it yourself instead of complaining.

https://bugzilla.mozilla.org/page.cgi?id=etiquette.html
Comment 140 Timwi 2008-08-14 04:08:28 PDT
Ryan's comment is misleading. Don't waste your time trying to implement this. Your patch won't be accepted anyway.
Comment 141 Brad 2008-08-14 12:08:13 PDT
/agree with Timwi

It's not whether the "developers" won't fix it. Problem is the governing body won't approve it.

Note to herceles: 1 year isnt bad, I've been waiting for this one bug reported in 1998 to get fixed.
Comment 142 Hercules Gunter 2008-08-14 21:07:16 PDT
With reference to Ryan Jones' comment: the comments added here are not spam, but new people finding the problem, and people trying to suggest ways to get around the problem.  They also serve to indicate that the problem is one people keep trying to get around and that it rates attention - if nothing new was being said, it would be easy to assume that people had worked out solutions or come to terms with this deviant behaviour, which would in turn justify no action being taken.

Brad: It's actually 6.5 years, but it is at least the current century's bug, unlike yours.

Frankly, this issue undermines Firefox's credibility for me.  New glitzy features keep getting added, but the basic functionality is still flawed, and I would rather, to use a motoring metaphor, have functional windscreen wipers than 5.1-channel sound on my navigator system.  Considering this alongside with the bungling of session-handling in recent releases (yes, a separate issue, but is it worth reporting it as a problem?), I have changed from being an enthusiast to a seeker after a new browser, and one day I'll find the time to look.
Comment 143 Ryan Jones 2008-08-15 01:13:37 PDT
(In reply to comment #142)
> With reference to Ryan Jones' comment: the comments added here are not spam,
> but new people finding the problem, and people trying to suggest ways to get
> around the problem.

Actually most of them are not. They violate rule 1.1 of the Bugzilla Etiquette. You guys are suggesting a patch won't be accepted when you haven't even tried to write and submit one. You can't expect others to fix what you aren't willing to fix yourself people.
Comment 144 Timwi 2008-08-15 03:50:42 PDT
> They violate rule 1.1 of the Bugzilla Etiquette.

Which is a good indication that nobody knows this "Etiquette" page even exists, much less reads it.

> You guys are suggesting a patch won't be accepted when you haven't even tried
> to write and submit one.

Correct. There are rejected patches from other people on BugZilla. I have no reason to believe that mine would be any different.

> You can't expect others to fix what you aren't willing to fix yourself people.

Perhaps, but you should still consider ideas from non-coders. Not everyone who makes sensible design suggestions can implement them by themselves, and not everyone who is a good coder makes sensible design decisions. See:
http://mpt.net.nz/archive/2008/08/01/free-software-usability
Comment 145 Hercules Gunter 2008-08-17 17:39:04 PDT
In response to Ryan Jones:

I've rather presumed that access to the primary code which constitutes the official release of Firefox is restricted to a bunch of developers who maintain and enhance it.  Not just anybody is able to change it, surely?  Hence people discuss the matter here.

The source code can be downloaded, I believe, so I could generate my own, personal copy of Firefox which works correctly, but that would not help the users of my software unless I were to distribute my FireFoxFixed.  The thing we don't want is a proliferation of Firefox versions, the way Linux is fragmented.  We want the official release to work correctly, don't we?
Comment 146 Ryan Jones 2008-08-19 07:40:02 PDT
@Hercules Gunter: Not really. You can write patches, if they get a review and a super review then you can seek to get them landed on a release build. It's a simple matter to download the code, write patched and submit diff files here for the developers to look at and comment on.
Comment 147 Jesse Ruderman 2008-08-19 13:01:42 PDT
You might have better luck getting a patch for bug 312094 accepted.

Bug 312094 - Add support for <select oninput>
Comment 148 steve.chambers 2009-06-29 02:57:34 PDT
Just to add my small and insignificant voice to those in favour of a change here and a "real world" example to back this up:

In ASP.Net, there is an "autopostback" property for a DropDownList:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.autopostback.aspx

This is implemented by the following client-side code, which doesn't work in Firefox due to this issue:

onchange="javascript:setTimeout('__doPostBack(\'<<<Client ID>>>\',\'\')'

This of course fires in IE but not Firefox...
Comment 149 Jesse Ruderman 2009-08-04 22:51:42 PDT
*** Bug 508242 has been marked as a duplicate of this bug. ***
Comment 150 Jesse Ruderman 2009-08-05 08:05:53 PDT
*** Bug 508242 has been marked as a duplicate of this bug. ***
Comment 151 Roger Espel Llima 2009-10-22 03:26:58 PDT
I agree with Brendan Eich's comment (#123) about how it's often possible to both have our cake and eat it.  In this case, I think the best way to do that is via a user preference to toggle between the two behaviours, with the default being to fire the event on each keypress that changes the value.

One point that I think has not been made, is that pressing the Enter key to 
fire the event is absolutely not intuitive or learnable. The Enter key on 
most form elements actually submits the form, which is something you don't want
to do lightly. Nobody will think that pressing Enter on a select element does 
something entirely different, and there's no way the interface will teach them.

The current behaviour is only useful for those users who navigate exclusively
by keyboard, and that only after they have learned the "Enter key" trick.

The alternative behaviour (firing the event every time) is better for programmers
(more consistency between browsers) and works better with dynamic forms, since
it means that users never have to see an inconsistent state where the select
box has been updated but not the other form elements.

I think it's clear enough that this second behaviour is better in the vast
majority of cases.  And for anyone who needs to use the keyboard for navigation on
BROKEN SITES, since they already have to learn the special usage of the Enter
key, I don't think it's too onerous to ask them to install an extension or 
toggle a preference.
Comment 152 gaoninza2 2009-10-22 04:51:57 PDT
I'd like use scroll wheel when I active a option box. This behaviour is available in IE6.
http://fpts.com.vn/user/chart/
When you use Mouse scroll in "Stock exchange", you can see the image changing.
This is a nice performance of "onChange"
But IF you use firefox, using scroll wheel is scoll page. So bad.
Comment 153 Jesse Ruderman 2009-10-22 13:20:54 PDT
Comment 152 is another bug.  (Maybe bug 500954, bug 406020, or bug 99669.)
Comment 154 Hercules Gunter 2009-10-22 17:15:05 PDT
In response to comment 151 (Roger Espel Llima)

Introducing a new unusual (and non-intuitive) behaviour, as you suggest, would make for a less consistent and predictable experience for the user, and not improve things at all for the developer.  The problem is that the FireFox behaviour is deviant.  Every other implementation of the combo box/dropdown list, in every other browser and in non-browser software, I have ever come across supports the following behaviours:
- clicking with a mouse will open the list, allow scrolling and selecting of an item, and on selection the list closes and the on-change event fires;
- Alt+Down will open the list, scrolling is possible with the up/down keys, typing a letter advances to the next item starting with that letter (occasionally, typing continuously will search for the next word starting with that sequence), and Enter will close the list and fire the on-change event;
- up/down will move through the list, typing behaves as for an opened list, and each new selection fires the on-change event.
If you've ever suffered from mouse-induced RSI/OOS/CTS (or whatever you prefer to call this painful condition), you use one of the non-mouse methods.

Firefox differs in that in the last case, it does not fire the on-change event unless one then opens and closes the list, or moves the focus to another control.  Supporters of this deviant behaviour argue that the RFC (Request for Comment) can be so interpreted.  Given that all other implementations of this otherwise-standard control behave differently, the RFC statement must be in error.  Perhaps the solution is to get the W3C to issue a corrected RFC?

The argument for the present behaviour is that it would cause inconvenient results if this (input) control is used as a navigation tool.  Therein lies the problem, though: it's not a navigation tool, but an input tool, and using it as a navigation tool is not a good idea, especially since visitors to such sites who use other browsers will suffer the annoyance (of disappearing to another location if they use the arrow keys), and that's still probably most visitors.  But it seems that a small number of people who happen to be able to choke the fixing of this bug happen also to like perverting the dropdown list in this way, and so Firefox is a far less desirable browser than it would otherwise be - certainly, it's no longer my favourite.

The fact that people keep rediscovering this deviant behaviour suggests strongly that the majority view is that it's an undesirable behaviour.  I doubt that it will change unless an RFC describes the intended behaviour correctly, and even then I would not be hopeful.

The problem with the present behaviour is that selecting a new value with the arrow keys does not, as with every other way of selecting a new value in this control, result in updating of other parts of the page should this be desirable.  This means that the behaviour of the control is annoyingly inconsistent, and the user experience is significantly poorer when using richly-interactive applications with Firefox.
Comment 155 Roger Espel Llima 2009-10-26 02:29:22 PDT
In response to #154: We're basically in agreement that the default behaviour
should be to fire the event. We're giving the same reasons why this is good
(dynamic forms stay consistent on-screen), and I'm also giving reasons why the
opposite behaviour is not so good (the Enter key trick is not intuitive or easy
to discover).

For users who need to navigate using the keyboard alone, as you point out, they
already have the possibility to open the drop-down box with Alt-Down, navigate
it and press Enter.

Now, if some people find it really important that one should be able to
navigate such a box, without the events firing, using the arrows alone, well,
I'm not going to deprive them of their convenience.  I merely suggest moving
this special-case behaviour to a user preference, because it's clearly not the
best thing for the vast majority of users.

Just having this option does not make the user experience "non-predictable",
since you just get the default (and sensible) experience, unless you actually
went and chose the other one.  Think of it as just another accessibility
option. It does not make life any harder for the developer either, because anyone
who has explicitly configured their brower not to fire the event on keypresses
can be expected to handle the resulting inconsistencies, and to know that you
need to press Enter or tab away.  They actually want it this way, so the 
developer does not need to do anything special about it.

To summarize, the main point is that the event should fire by default.  But if
a small percentage of people really like using the arrows followed by Enter,
rather than pressing Alt-Down first, there is no major problem with giving them
that as a user-configurable option.  It's truly a question of how the user
prefers to interact with select boxes.

The question now becomes: is there ANY REASON LEFT not to change the default
behaviour?  I think all the given reasons have been thoroughly refuted by now.
Comment 156 Hercules Gunter 2009-10-26 17:05:09 PDT
Response to #155:

Roger, I understand what you're saying, but my point is that this is just one implementation of a standard control, used in many contexts (Web sites as well as thick-client software), and for that reason the behaviour should be predictable and consistent in all implementations - rather like the indicator control on a car, which should always rotate to the right to turn on the right indicator, rotate left for left, and never be implemented with forward/back motion.

The difference in behaviour can only be at the client side, and the difference in what the control is used for can only be at the server side.  Inflicting a difference on Firefox users at the client side makes the Firefox implementation unsatisfactory, and makes the browser's behaviour non-standard from the point of both users and developers.  It's not just that the behaviour in Firefox is different from every other browser (IE, Opera, Safari, Chrome, Netscape before IE became dominant), but that it's different from every other implementation of the combo box I have ever come across in any other OS or development tool.
Comment 157 Mounir Lamouri (:mounir) 2010-12-13 16:24:24 PST
*** Bug 508242 has been marked as a duplicate of this bug. ***
Comment 158 bruce 2011-06-01 13:18:04 PDT
For consistency just within the (non-multiple) select element itself, when the current option is changed, either onchange should not fire (via mouse nor keyboard), or it should fire (via mouse or keyboard action).  It seems clear to me the latter is preferred and what I was expecting.

Not only would it make the onchange event work consistently for this one type of element, but it sounds like it would bring it in line with other browsers and more importantly, it's just logical.  onchange, for an element should should trigger on change.  Why have it fired just because a mouse movement changed the selected option, but not when a keyboard action changed it??  (If using the mouse, I am not losing focus, but just selection another option and the onchange fires.  So forget about something losing or gaining control!  And please don't cloud the situation by suggesting that people change their design to use blur or enter key - the goal should be to make this element work in a consistent, logical way.)

I just wanted to change a total field that calculates times of day when the operator changes AM to PM or back.  I was very surprised when testing that down arrow did not trigger the onchange.  not good.
Comment 159 CPK Smithies 2011-06-01 20:25:58 PDT
Very much agree with bruce above.
Comment 160 bruce 2011-06-02 09:17:32 PDT
(In reply to comment #159)
> Very much agree with bruce above.

Also, to clarify a bit more: The onchange should be firing if the selected option has changed regardless of what caused it from the keyboard. So this would include, for instance keying a letter that matches an option that would result in that option becoming the new selected value (without ever using the mouse).  

So Brad was right way back in 2007 and then later (comment 136).  I am really surprised that FF has lagged behind on this for so long.  It seems onchange meant one thing long ago, then everyone wanted to get more dynamic and now everyone except FF has met these obvious needs.  Except they didn't meet them now, they met them long ago.

I am sure most of us have used a page where you have a series of selects where ajax or json scripts are used to tailor each subordinate select element's options based on the selection of the last (visit any tire merchant site, where you have several selects in a row for year, make and model).  FF usually works, but stumbles through these (it is sometimes visually obvious) because it is not triggering onchange immediately as the selected options change. It appears as if it is trying to catch up as you open each subordinate select (gaining focus on a 'child' select right after losing focus on a 'parent' select).  On some sites, keyboard alone is almost unusable for this scenario as various kinds of additional disabling/re-enabling trickery been applied to keep users out of trouble. This is not an issue of navigation - this is a matter of using a page in all its dynamic glory using the keyboard.

Sad that the several year old IE is more logical and useful on this point.
Comment 161 bruce 2011-06-02 10:37:36 PDT
(In reply to comment #160)
> (In reply to comment #159)
> > Very much agree with bruce above.
> 
> Also, to clarify .... [snipped rest of my own reply]

Seems this problem sloshed its way into Safari design as well.  There, the behavior is even more inconsistent - patched in the wrong way. Using up/down arrows, now the select window is opened showing what currently is selected and the operator must hit enter to change the current selection. This would be acceptable if it were not inconsistent with what happens when using another keyboard key that matches an option value that causes the current selection to change (without losing focus of the select element); here again in this latter case, onchange is not firing.  Ridiculous.  How has this gone on for so long?
Comment 162 lwz 2011-11-30 21:16:37 PST
I didn't read the entire thread, but I think, as what some of the above posters do, that the keyboard selection should be consistent with the mouse selection. A direct change in the select box without a drop-down should be considered the same as an entire process of drop-down, selection/roll-up, and thus should trigger the onchange. If the user so wishes to change without triggering the onchange, he should press Alt-Down to get the select to drop-down and do the selection with the keyboard. This should not trigger the onchange until the selection is made.

Also, I don't see why Firefox is inconsistent with the other browsers in another aspect. I might want to file a new bug for this: as the user is selecting in the *drop-down* with his mouse/keyboard, the value for the entire select control *changes* even though the onchange event has not fired!
Comment 163 Artjom Simon 2013-04-17 11:48:16 PDT
To bring fresh air to this bug:

- This bug was submitted in 2002. Today's Aurora build still behaves different than any other browser with significant market share, in that it doesn't fire the change event on the actual *change* of the selected option using the arrow keys, but rather decides to wait until the select element's focus is lost.

- Test case here: http://jsfiddle.net/aPAMx/2/

This behavior is unexpected and unintuitive:

- Unexpected, because a *change*, as the event is called, occured, but the browser decides it won't fire the one event specifically bound for this purpose.

- Unintuitive, because the user has to discover by chance that clicking somewhere else after changing his selection magically triggers the event. Because there is an indefinite delay in that process, most likely, the user will think the lag occurs due to a glitch in the software (High CPU/IO load, bug, etc)

- We don't have to follow W3C's HTML 4.01 draft anymore. I'm with Graham Lea from comment #24 here, who in 2004 boldly suggested that the W3C was wrong here (and again; even in 2004 all other browsers implemented this feature "correctly", except Firefox).
Concerning this bug, I couldn't find a recent (HTML5.1/UAAG2.0) W3C recommendation on what to do in this case. If anyone can provide a link, that would be great.

- Today's HTML5 is heavily JavaScript based. The "change" event on the select item has real-world use cases, which don't work in Firefox when using keyboard selection.

- Real-World Example: http://www.swp.de/1948815 - here we use the "Datawrapper" script library, which in turn uses jQuery to bind a function to the "change" JavaScript event of the select box so that the data chart gets updated when you select another entry (full screen link here: http://s3.datawrapper.de/T6n0W/?fs=1 ) This won't happen if you decide to use the keyboard with up/down arrow keys to quickly compare two datasets.

I strongly suggest we start reevaluating this bug again, today.
Comment 164 Jesse Ruderman 2013-04-17 14:06:50 PDT
I think I agree with Artjom (see my comment 54).

It would be best if sites were careful about when to use oninput and when to use onchange, but in practice they're going to test with mouse or trackpad input and decide that onchange is what they want.  See also bug 858917 for <input type=range>.

We should probably try to get the spec changed too:

http://www.w3.org/html/wg/drafts/html/master/forms.html#event-input-change

"When the change event applies, if the element does not have an activation behavior defined but uses a user interface that involves an explicit commit action ..."

http://www.w3.org/html/wg/drafts/html/master/forms.html#the-select-element

"Upon this option element being picked (either through a click, or through unfocusing the element after changing its value, or through a menu command, or through any other mechanism) ..."
Comment 165 Nickolay_Ponomarev 2013-05-17 17:42:44 PDT
*** Bug 380384 has been marked as a duplicate of this bug. ***
Comment 166 Nickolay_Ponomarev 2013-05-17 17:43:02 PDT
*** Bug 807948 has been marked as a duplicate of this bug. ***
Comment 167 Thomas Eynon 2013-06-18 10:33:15 PDT
I agree with both Artjom as well. I asked this question on SO in Jul of 2011: http://stackoverflow.com/questions/6587059/javascript-onchange-arrow-keys

Since then, Chrome has updated to using arrow keys.
Comment 168 Elbart 2013-11-19 03:08:00 PST
I think I've encountered this bug today while trying to enter the CC-details into GOG's payment-form: http://i.imgur.com/aRPe5ih.png

If I read their code correctly, they're using jQuery's 
.trigger("change") in _min_checkout.js.

I'm clicking into the "Card number"-line, and then switch the focus with the tab-key. No point in using the mouse there.

When I want to change the month and year of the expiration date, I cannot see what value I've highlighted until I change focus to the next object with tab or a mouseclick.

No such problem with IE9(!) and newer or Chrome 31.
Comment 169 jbalyo 2014-02-06 13:50:07 PST
I believe arrow keys should fire onchange events for dropdown lists. If they do not, then onchange is exactly like onblur. In that case, what's the point of having both? They both only fire when the focus changes. Logically, "on change" should occur when the VALUE changes not when FOCUS changes. I agree with comment #24 - in this case w3c got it wrong.
Comment 170 Boris Zbarsky [:bz] (still a bit busy) 2014-02-07 06:15:48 PST
*** Bug 969068 has been marked as a duplicate of this bug. ***
Comment 171 Patrick H. Lauke 2014-06-23 06:55:24 PDT
Just some anecdotal evidence again that this behavior is surprising and undesirable: for an otherwise perfectly accessible dynamic form (which displays additional form fields after a select, tied to onchange), I'm now having to add extra JavaScript (mostly just for Firefox) to programmatically handle keyboard focus...
Comment 172 Pat 2015-06-09 13:07:35 PDT
The expected behavior is a change of selection option triggers onchange.  This currently occurs for a mouse user on the second click of the select box (one to open, one to select from the list...) but the focus does not change.  If I managed to focus on the select box by tabbing and then used the mouse to select an option, my focus hasn't changed.  

By the currently accepted interpretation of Firefox, the onchange event shouldn't fire for a mouse user on that second click, but on loss of focus of that dropdown element.  A mouse user should have to click on something else on the page or tab for that onchange event to fire.   

This inconsistency, namely that keyboard users are treated differently than mouse users, has lead to accessibility issues for many of us developers because we have to address an inconsistent treatment of users built into the browser.  Mouse users have preferred treatment for selecting options currently, as their selection is treated as "real" while a keyboard user is treated as "incomplete" for what is essentially the same action.  

This appears to be applied unevenly, as the "loss of focus" argument is only used with regard to keyboard access, never to mouse access.  If we had consistent treatment (either mouse users don't get onchange until loss of focus, or keyboard users get change events on change of selected options) it would help to address current issues we have with trying to develop a consistent experience for all of our users regardless of access type chosen for interaction.  

I would like to see this addressed cogently with consistent arguments, and would prefer the status be changed from "wontfix."
Comment 173 jared.crutchfield 2016-07-24 04:02:51 PDT
Just wanted to reiterate a workaround that I used that does work (for me) posted earlier by Simon Wunderlin. The patch can be found here: https://bugzilla.mozilla.org/show_bug.cgi?id=126379#c115 or https://bug126379.bmoattachments.org/attachment.cgi?id=235225 (direct).

It's as easy as adding the js to the page and a size="1" attribute to each select control you want to apply the workaround to.

Regardless of whether the browser should be changed or not, it is important to remember that not all users will have new browser versions so older versions must be supported, and this little hack works wonderful.

Web devs, be sure to check it out.

Shout out and thankyou to Simon Wunderlin for contributing the workaround.

Note You need to log in before you can comment on or make changes to this bug.