Yomguithereal / react-blessed

A react renderer for blessed.
MIT License
4.46k stars 176 forks source link

Fix issue when updating data or rows properties #25

Closed esnunes closed 9 years ago

esnunes commented 9 years ago

In order to update data or rows properties of Table and ListTable the method setData must be called.

Yomguithereal commented 9 years ago

Hello @esnunes. Thanks for this sensible fix. Can you affirm that the rows and data properties are not used differently by some other widgets?

esnunes commented 9 years ago

Hi @Yomguithereal ,

Based in blessed documentation there is a rows in node element and data also. To better handle this and avoid surprises I'm considering check if the node has setData method before call it, what do you think? In case you agree I will change both PR.

    // Table and ListTable data / rows
    else if ((key === 'data' || key === 'rows') && node.setData)
      node.setData(value);
Yomguithereal commented 9 years ago

This seems to do the trick @esnunes. Let us go this way!

esnunes commented 9 years ago

Thanks @Yomguithereal , I've updated both PR.

Yomguithereal commented 9 years ago

Thanks @esnunes. Merging your PR right now and releasing a new version with your fixes.

Yomguithereal commented 9 years ago

0.1.5 is now live. Thanks @esnunes.

esnunes commented 9 years ago

Thanks @Yomguithereal !