Please report any other irregularities here.
(spawned off from bug 307339 comment 10/11 and 319326 comment 10) Combobox selectedIndex should not change at all from just hovering options in the dropdown menu - IE7, Opera9 and Safari/Webkit don't change it, only if you actually select something. This bug also occur in Firefox 2. STEPS TO REPRODUCE (mouse) 1. click on the combobox 2. hover the options in the dropdown menu selectedIndex should not change in 2. (its value is logged in the textbox with 1 sec intervals) STEPS TO REPRODUCE (keyboard) 1. click on the combobox 2. press UP/DOWN keys Again, selectedIndex should not change in 2. EXPECTED RESULT selectedIndex should reflect the selected value for the combobox, it should not change until the user clicks on an option or press RETURN Whether or not the displayed value in the combobox should change in the keyboard case in another matter. IE7 does change it; Opera doesn't; Hard to say what Safari does since the dropdown covers the combobox but I'm guessing it doesn't change based on the check mark on the currently selected option in the menu (which does not change).
I think we need some serious automated regression tests before we tackle this....
This seems intentional from this comment in nsComboboxControlFrame.cpp. Does anyone know why? mozila-1.9.1/layout/forms/nsComboboxControlFrame.cpp: 657 // In dropped down mode the "selected index" is the hovered menu item, 658 // we want the last selected item which is |mDisplayedIndex| in this case.
You could look at the CVS blame, right?
Would someone confirm that this bug is indeed a bug and that we are not following the html spec? Someone on Angular.js github issue tracker told me this issue would relate to my issue I was facing. Please see https://github.com/angular/angular.js/issues/3753#issuecomment-27491232
Quote from the html spec: "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) ... [the value should be changed]". Hovering between options with the mouse, causes the option you just left to be assigned as the selectedIndex. It also happens when moving from an option off to space outside. In both cases, you are not 'selecting an item' via a click. Using the keyboard and tabbing away it would make sense to update the index as focus moves, but this behavior with mouse movement is silly. For example, if the user clicks a select and moves their mouse down to select the last of 10 options, 9 different changes to the selectedIndex will be made even though the user hasn't really 'selected' anything until they click on the option they were going for. Passing their mouse over options on the way to the one they want to click on doesn't constitute "changing its value". This behavior makes it impossible for me to get my application working as I want in Firefox.
Turns out rendering differences in other browsers are also causing problems, so I'm abandoning my approach entirely and this bug fix will no longer affect me.
Duplicate of this bug: 1039047
You need to log in before you can comment on or make changes to this bug.