Adorkable / node-red-contrib-ui-led

A simple LED status indicator for the Node-RED Dashboard
MIT License
16 stars 12 forks source link

Changing from fixed size back to auto messes up LED size #68

Closed yoiang closed 3 years ago

yoiang commented 3 years ago

Reported by kuema here: https://discourse.nodered.org/t/announce-node-red-contrib-ui-led-0-4-6/39472/3

Describe the bug Size of LED grows to incorrect size if going from fixed size to auto size

To Reproduce

  1. Add an LED set to auto
  2. Change size to a fixed on, say 1x1
  3. Close Edit panel
  4. Change size back to auto
  5. Close Edit panel
  6. Deploy

Expected behavior Should return to auto size

Screenshots

From the flow, looks like width and height are being saved as strings

Versions

kuema commented 3 years ago

I did a little digging, too. 🤓

It seems only the initial values are numbers. As soon as you change the size in any way, they end up as strings as well, like "width": "1". So this might be a general Dashboard thing.

The problem is this strict comparison.

https://github.com/Adorkable/node-red-contrib-ui-led/blob/15f73cc411a93ea2b31cf98a5024a22e1d55eaa0/src/nodes/ui_led/ui_led.html/processing.ts#L34

So, one can either use == or convert the width to a number first.

bburkett52 commented 3 years ago

I am seeing another issue that may be related to this issue. When displayed on my iPhone, in portrait orientation, the LED initially shows as a thin vertical slit. If I rotate the device 90 degrees, to landscape mode, the LED displays properly and then even when rotated back to portrait mode. This anomaly began with the 0.4.7 version.

62195

Regards, Bob

yoiang commented 3 years ago

I have addressed the bug @kuema you and others had run into with 0.4.8, please let me know if you have any issues!

@bburkett52 let me take some time to reproduce the issue, if it's still happening I'll make a new issue. Thanks so much for reporting it :)

bburkett52 commented 3 years ago

@yoiang,

Thanks you for your work! I have updated to version 0.4.8 and still have the same issue on my phone. All is good on on larger displays.

Regards, Bob

yoiang commented 3 years ago

@bburkett52 please track progress on the issue you're seeing #72 !