fix: fix preact compatibility

fixes #254
nolan/hinaloe-test
Nolan Lawson 2019-03-10 09:14:47 -07:00
parent 8c80e7d4e5
commit 59c4d87839
1 changed files with 3 additions and 4 deletions

View File

@ -16,8 +16,6 @@ export default class Category extends React.Component {
}
componentDidMount() {
this.parent = this.container.parentNode
this.margin = 0
this.minMargin = 0
@ -66,11 +64,12 @@ export default class Category extends React.Component {
}
memoizeSize() {
var parent = this.container.parentElement
var { top, height } = this.container.getBoundingClientRect()
var { top: parentTop } = this.parent.getBoundingClientRect()
var { top: parentTop } = parent.getBoundingClientRect()
var { height: labelHeight } = this.label.getBoundingClientRect()
this.top = top - parentTop + this.parent.scrollTop
this.top = top - parentTop + parent.scrollTop
if (height == 0) {
this.maxMargin = 0