fix scroll-to-selected

This commit is contained in:
rlx 2019-02-01 15:19:34 +05:30
parent 22d9d92369
commit 41f32ae341

View file

@ -500,9 +500,12 @@ txtjs.selectNote = function(id, trigger) {
elements.forEach(function(element) { elements.forEach(function(element) {
element.classList.add('selected') element.classList.add('selected')
}) })
// FIXME: SCROLL for (let i = 0; i < elements.length; i++) {
// elements[0].scrollIntoView() if (!elements[i].parentNode.id.includes('scroll')) {
// window.scrollTo(0, elements[0].offsetTop) elements[i].scrollIntoViewIfNeeded()
break
}
}
} }
if (trigger !== false) { if (trigger !== false) {
txtjs.postMessage('selectNote', {id: id}) txtjs.postMessage('selectNote', {id: id})