fix scroll on focus by taking into account border/itop.

This commit is contained in:
Christopher Jeffrey 2015-04-04 00:08:10 -07:00
parent 08bb19e17f
commit 861ec57327
1 changed files with 3 additions and 1 deletions

View File

@ -1556,7 +1556,9 @@ Screen.prototype._focus = function(self, old) {
el.scrollTo(self.rtop);
self.screen.render();
} else if (self.rtop + self.height - self.ibottom > el.childBase + visible) {
el.scrollTo(self.rtop - (el.height - self.height), true);
// Explanation for el.itop here: takes into account scrollable elements
// with borders otherwise the element gets covered by the bottom border:
el.scrollTo(self.rtop - (el.height - self.height) + el.itop, true);
self.screen.render();
}
}