Better scrollTo offset
This commit is contained in:
parent
a9a453f51f
commit
b256e1c8ce
|
@ -397,9 +397,10 @@ export default class TreeMode extends Component {
|
||||||
const name = compileJSONPointer(path)
|
const name = compileJSONPointer(path)
|
||||||
const container = this.refs.contents
|
const container = this.refs.contents
|
||||||
const elem = container.querySelector('div[name="' + name + '"]')
|
const elem = container.querySelector('div[name="' + name + '"]')
|
||||||
|
const offset = -(container.getBoundingClientRect().height / 4)
|
||||||
|
|
||||||
if (elem) {
|
if (elem) {
|
||||||
jump(elem, { container, offset: -100, duration: 400 })
|
jump(elem, { container, offset, duration: 400 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue