benplum/Selecter — pull request #2 by Kylemade (2013-01-24 09:16:57+00:00)
Title: Fixes for Firefox

Version 1.8.2 of Selecter has issues that prevent it from working correctly in Firefox 18.0.1 (and earlier) on Mac 10.8.2 and Windows. Here are the fixes.

1. On line 388, I've added support for the left and right arrow keys. Follow the steps below to see why:
* Make the native select element (with the class "selecter-element") visible on your demo page's ["Basic" example](http://www.benplum.com/formstone/selecter/).
* Use the left and right arrows to increment / decrement the focused select element.
* Notice that while the native element is updated, the corresponding Selecter element (with the class "selecter-selected") does not change. As far as I can tell, Firefox is the only browser that supports left and right arrow key presses on select elements.
2. Line 440 is not needed for Firefox and is actually causing some very odd behavior when used with the up and down arrow keys. Try the following to recreate one of the issues:
* Use the up arrow to increment / decrement the focused Selecter.
* Notice that in the "Basic" example, the native select element stops at "Two" and only continues after the Selecter element has reached its final option. Although the selected attribute is updated correctly on the native element, the value sent to the server on submit matches the visible option's value on the native element (as opposed to the option with the "selected" attribute).
* You may also need to change line 454 to the following, as I have not done any testing with option groups yet:

`if (!isFirefox) data.$optionEls.eq(index).attr("selected", null);`

Thanks for this fantastic plugin!