Merge pull request #285 from nolanlawson/fix-preact-compat-part-2

fix: fix preact compatibility
nolan/hinaloe-test
Nolan Lawson 2019-03-12 08:20:17 -07:00 committed by GitHub
commit e2694b544b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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