diff --git a/lib/widget.js b/lib/widget.js index ee8af4f..a6f7e18 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -6976,11 +6976,8 @@ function Table(options) { this.setData(options.rows || options.data); this.on('resize', function() { - var rows = self.rows; - // XXX Need to clear previous box. - self.setData([]); - self.screen.render(); - self.setData(rows); + self.setContent(''); + self.setData(self.rows); self.screen.render(); }); } @@ -7027,7 +7024,7 @@ Table.prototype._calculateMaxes = function() { }; Table.prototype.setRows = -Table.prototype.setData = function(rows, render) { +Table.prototype.setData = function(rows) { var self = this , text = '' , line = '' @@ -7292,11 +7289,9 @@ function ListTable(options) { this.setData(options.rows || options.data); this.on('resize', function() { - var rows = self.rows; - // XXX Need to clear previous box. - self.setData([]); - self.screen.render(); - self.setData(rows); + var selected = self.selected; + self.setData(self.rows); + self.select(selected); self.screen.render(); }); } diff --git a/test/widget-listtable.js b/test/widget-listtable.js index 6daa3f0..627a67a 100644 --- a/test/widget-listtable.js +++ b/test/widget-listtable.js @@ -15,8 +15,8 @@ var table = blessed.listtable({ align: 'center', tags: true, keys: true, - height: 5, width: '80%', + height: '70%', vi: true, mouse: true, style: {