1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

debug autoscroll

This commit is contained in:
Dick Choi
2016-06-01 09:35:48 +09:00
parent 0c2226b3fc
commit c691af9712

View File

@@ -46,7 +46,7 @@ class NoteList extends React.Component {
let list = this.refs.root let list = this.refs.root
let item = list.childNodes[targetIndex] let item = list.childNodes[targetIndex]
let overflowBelow = list.clientHeight + list.scrollTop < item.offsetTop + list.clientHeight let overflowBelow = item.offsetTop + item.clientHeight - list.clientHeight - list.scrollTop > 0
if (overflowBelow) { if (overflowBelow) {
list.scrollTop = item.offsetTop + item.clientHeight - list.clientHeight list.scrollTop = item.offsetTop + item.clientHeight - list.clientHeight
} }