Merge pull request #285 from nolanlawson/fix-preact-compat-part-2
fix: fix preact compatibilityrelease
commit
e2694b544b
|
@ -16,8 +16,6 @@ export default class Category extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.parent = this.container.parentNode
|
|
||||||
|
|
||||||
this.margin = 0
|
this.margin = 0
|
||||||
this.minMargin = 0
|
this.minMargin = 0
|
||||||
|
|
||||||
|
@ -66,11 +64,12 @@ export default class Category extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
memoizeSize() {
|
memoizeSize() {
|
||||||
|
var parent = this.container.parentElement
|
||||||
var { top, height } = this.container.getBoundingClientRect()
|
var { top, height } = this.container.getBoundingClientRect()
|
||||||
var { top: parentTop } = this.parent.getBoundingClientRect()
|
var { top: parentTop } = parent.getBoundingClientRect()
|
||||||
var { height: labelHeight } = this.label.getBoundingClientRect()
|
var { height: labelHeight } = this.label.getBoundingClientRect()
|
||||||
|
|
||||||
this.top = top - parentTop + this.parent.scrollTop
|
this.top = top - parentTop + parent.scrollTop
|
||||||
|
|
||||||
if (height == 0) {
|
if (height == 0) {
|
||||||
this.maxMargin = 0
|
this.maxMargin = 0
|
||||||
|
|
Loading…
Reference in New Issue