Im-Beast / deno_tui

🦕 Deno module for creating Terminal User Interfaces
https://deno.land/x/tui
MIT License
266 stars 18 forks source link

bug: min/max property changes aren't reactive in ProgressBarComponent #17

Closed aapoalas closed 1 year ago

aapoalas commented 1 year ago

What this feature is meaning to achieve Currently ProgressBarComponent does not react to min/max values changing. The code seems to be written in such a way that it should, but somehow it does not. eg. If I create a bar with min/max initially both at 0, then later (when a stream gives me a value) change the max to 500 the bar will stay empty. Additionally, clicking on anywhere on the bar will always "change" the value to 0.

Describe alternatives you've considered I've tried manually calling .draw() on the bar, also calling .remove() and then .draw(). Probably calling .remove() and then creating a new bar with the new min / max value would work.