Fix updating `ListView` when it's hidden
MODIFY
lib/project/list-view.js
lib/project/list-view.js
@@ -8,6 +8,8 @@ module.exports = class ListView {
this.heightForItem = heightForItem;
this.itemComponent = itemComponent;
this.className = className;
+ this.previousScrollTop = 0
+ this.previousClientHeight = 0
etch.initialize(this);
resizeDetector.listenTo(this.element, () => etch.update(this));
@@ -27,7 +29,15 @@ module.exports = class ListView {
let itemTopPosition = 0;
if (this.element) {
- const {scrollTop, clientHeight} = this.element;
+ let {scrollTop, clientHeight} = this.element;
+ if (clientHeight > 0) {
+ this.previousScrollTop = scrollTop
+ this.previousClientHeight = clientHeight
+ } else {
+ scrollTop = this.previousScrollTop
+ clientHeight = this.previousClientHeight
+ }
+
const scrollBottom = scrollTop + clientHeight;
let i = 0;

MODIFY
lib/project/results-view.js
lib/project/results-view.js
@@ -134,7 +134,6 @@ class ResultsView {
const pathDetailsHeight = this.refs.dummyResultView.refs.pathDetails.offsetHeight;
const matchHeight = this.refs.dummyResultView.element.getElementsByClassName('search-result')[0].offsetHeight;
if (pathDetailsHeight !== this.pathDetailsHeight || matchHeight !== this.matchHeight) {
- console.log('NEW MEASUREMENTS', pathDetailsHeight, matchHeight);
this.pathDetailsHeight = pathDetailsHeight;
this.matchHeight = matchHeight;
etch.update(this);

Fix updating `ListView` when it's hidden