pdong / node-contrib-inovelli-status-manager

Node red node for assisting in constructing statuses for inovelli red series switch
1 stars 2 forks source link

Fix issue where display input would reset when opening palette #7

Closed pdong closed 4 years ago

pdong commented 4 years ago

Fixes #6

fix

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.