Wednesday, May 28, 2008

Firefox bug: deceiving select onchange event

I have been experiencing a silly bug in Firefox for 2 years now. It happens on my Ubuntu (Gnome) and formerly on Debian (Gnome too). I tried it on a Windows machine but it didn't work.
As usual, I am lazy to try it on all available platforms, so please help me in your comments!

Bug description:

If a select element has no option selected (selectedIndex == -1), an outside-select click behavior deceives the browser to fire the onchange event for the select.

How to reproduce bug:

  1. Click to open a select element

  2. Move your mouse over any option (make sure the option is highlighted, but don't click on anything)

  3. Click outside the select twice

  4. As a result of the bug, the onchange event is fired with the option under mouse as the select value

To see an example, the bug is illustrated here

I tried it on Ubuntu (Gnome and KDE) and it happens too.
I tried also on Firefox for Windows (through wine) and it happens too!

Now what?

No comments: