fix scroll-to-selected
This commit is contained in:
parent
22d9d92369
commit
41f32ae341
1 changed files with 6 additions and 3 deletions
|
@ -500,9 +500,12 @@ txtjs.selectNote = function(id, trigger) {
|
|||
elements.forEach(function(element) {
|
||||
element.classList.add('selected')
|
||||
})
|
||||
// FIXME: SCROLL
|
||||
// elements[0].scrollIntoView()
|
||||
// window.scrollTo(0, elements[0].offsetTop)
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
if (!elements[i].parentNode.id.includes('scroll')) {
|
||||
elements[i].scrollIntoViewIfNeeded()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trigger !== false) {
|
||||
txtjs.postMessage('selectNote', {id: id})
|
||||
|
|
Loading…
Reference in a new issue