From 0f91a133771ebe73dc0abc2b189faffd7f3e9ac2 Mon Sep 17 00:00:00 2001 From: Franz Heinzmann Date: Wed, 20 Sep 2017 12:01:24 +0200 Subject: [PATCH] Fix table scrolling, add select event. --- lib/widgets/listtable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/widgets/listtable.js b/lib/widgets/listtable.js index 16e81fd..0fc2a82 100644 --- a/lib/widgets/listtable.js +++ b/lib/widgets/listtable.js @@ -182,7 +182,12 @@ ListTable.prototype.select = function(i) { if (i <= this.childBase) { this.setScroll(this.childBase - 1); } - return this._select(i); + this._select(i); + // Correct scrolling for header offset. + this.scrollTo(this.selected - 1); + if (this.rows && this.selected) { + this.emit('selectrow', this.rows[this.selected], this.selected) + } }; ListTable.prototype.render = function() {