Make sure last category is selected when scrolled to bottom

release
Etienne Lemay 2017-05-27 12:58:46 -04:00
parent d8b4c81534
commit e28dc4da55
1 changed files with 8 additions and 0 deletions

View File

@ -233,6 +233,8 @@ export default class Picker extends React.Component {
activeCategory = category
break
}
} else if (scrollTop + this.clientHeight >= this.scrollHeight) {
activeCategory = this.categories[this.categories.length - 1]
}
if (activeCategory) {
@ -305,6 +307,12 @@ export default class Picker extends React.Component {
let component = this.refs[`category-${i}`]
if (component) component.memoizeSize()
}
if (this.refs.scroll) {
let target = this.refs.scroll
this.scrollHeight = target.scrollHeight
this.clientHeight = target.clientHeight
}
}
getCategories() {