The onchange was firing when opening the palette for the first time. I fixed this by setting the previous value when opening the palette and if the previous exists (value changing AFTER palette is open) then I reset the input. This introduced another bug where hiding options isn't correct. If you set the select value to an option that is hidden it, browsers will try to have make that the selection instead of the visible one. Instead of doing hide/show I switched it to just insert the whole set of options so value 2 for a dimmer doesn't say "Fast Blink" when opening. This should work now, hopefully.
I put a bunch of placeholder options in so that I can grab the value of the select before stomping on all the contents. Kind of gross but it works.
Fixes #6
The onchange was firing when opening the palette for the first time. I fixed this by setting the previous value when opening the palette and if the previous exists (value changing AFTER palette is open) then I reset the input. This introduced another bug where hiding options isn't correct. If you set the select value to an option that is hidden it, browsers will try to have make that the selection instead of the visible one. Instead of doing hide/show I switched it to just insert the whole set of options so value 2 for a dimmer doesn't say "Fast Blink" when opening. This should work now, hopefully.
I put a bunch of placeholder options in so that I can grab the value of the select before stomping on all the contents. Kind of gross but it works.