mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-25 18:29:26 +00:00
fix scroll on focus by taking into account border/itop.
This commit is contained in:
parent
08bb19e17f
commit
861ec57327
@ -1556,7 +1556,9 @@ Screen.prototype._focus = function(self, old) {
|
|||||||
el.scrollTo(self.rtop);
|
el.scrollTo(self.rtop);
|
||||||
self.screen.render();
|
self.screen.render();
|
||||||
} else if (self.rtop + self.height - self.ibottom > el.childBase + visible) {
|
} 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();
|
self.screen.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user