From 861ec57327a2b14d1ffcb8d6d8a78efd5dd304ed Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 4 Apr 2015 00:08:10 -0700 Subject: [PATCH] fix scroll on focus by taking into account border/itop. --- lib/widget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/widget.js b/lib/widget.js index daf6bc3..f83034a 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -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(); } }