Make sure last category is selected when scrolled to bottom
parent
d8b4c81534
commit
e28dc4da55
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue